[JDEV] Detecting client/server disconnect?

Jens Alfke jens at mooseyard.com
Mon Apr 9 13:12:30 CDT 2001


On Monday, April 9, 2001, at 10:56 AM, Todd Bradley wrote:

> I agree the TCP keepalive on the server might be more elegant, but this 
> is easier.

I have never used keepalive, but from what I read in the Stevens book, 
it sounds as though I can use it in my client without the server needing 
to use it too. After enough idle time my TCP stack will send "a TCP 
segment to which the [server] must respond" with an ACK or RST.

It would also be nice for the server to use keepalive so it can detect 
if a client crashes or loses connectivity, which is after all much more 
likely, but I think I can unilaterally use keepalive in my client. Is 
anyone planning to add it to the server? Seems like it would only take a 
few lines of code for Someone Versed In The Art of BSD sockets...

—Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1131 bytes
Desc: not available
URL: <https://www.jabber.org/jdev/attachments/20010409/0c597ae3/attachment-0002.bin>


More information about the JDev mailing list