Socket>>sendData: and slow networks

John M McIntosh johnmci at smalltalkconsulting.com
Wed Jul 5 22:39:58 UTC 2000


on 7/5/00 2:44 PM, Lex Spoon at lex at cc.gatech.edu wrote:

> 
> First, if it's a client app, *don't time out*!  There should be a way
> for the user to cancel an outstanding operation, anyway, and given such
> a mechanism, you can just let the user wait however long they feel like.

In Visualworks I once did an application that watch how long a work task was
taking, once over a threshold, then it prompted the user with a concurrent
dialog asking if it should cancel. If the main thread completed the work,
either because it was ok, or timedout then it would auto-close the dialog
window, if present.


{Hint and headless applications do...}

I'd guess in waitFor... you could fork off a task to wait 30 seconds, if we
wait that long then put up a dialog asking if we should cancel. If the user
cancels then tap things to stop the wait and terminate the waitFor.


Of course if we actually get control back in the main thread we kill the
dialog thread. 

Just watch the race conditions for termination via cancel, or termination
via proper response.

Anyone want to write this? I've a need for it for correspondence/flow
because the existing behavior is to wait forever for
connect/waitForReadability etc.

 
Not sure how you would decide you have a server, perhaps if you issue a
listenTo that's a clue...


PS correspondents/flow is inchs (cm) from being released with support for
the disney socket primitives and disney exception handling. Just a few more
little items to address. So existing users who might want to kick the tires
for me should email me for an early copy before I toss to the world and find
some embarrassing bug.

> 

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6
===========================================================================





More information about the Squeak-dev mailing list