[REBOL] Re: Checking for broken connections
From: sqlab:gmx at: 4-Nov-2003 8:47
> Ok, I asked this question a while ago and got some good answers, but a
> scenario has risen that I wasn't counting on before, and the previous
> solution doesn't work.
> Suppose you have a sever running:
> s: open/lines/no-wait tcp://:8000
> v: first s
> And a client:
> c: open/lines/no-wait tcp://ip-address:8000
> well if the client connection closes either because rebol closed down or
> connection was closed with a 'close c' command, you can check if the
> is still connected or not using 'check: copy v' on the server end and as
> long as it doesn't return 'none', the connection is still active.
> Well I discovered today that if the client computer turns off abrubtly
> >from a power outage) or crashes, that the connection will still come back
> active using this approach. Even though the remote computer is turned off
> (obviously disconnected) a copy on the server does not return 'none'.
> anyone know a solid way to check for this under such circumstances??
you can try to set the keep-alive option.
set-modes s [keep-alive: true]
and see if you get an event indicating the closure.
If not, you must provide your own time out action.
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
Jetzt kostenlos anmelden unter http://www.gmx.net
+++ GMX - die erste Adresse für Mail, Message, More! +++