[JDEV] Detecting client/server disconnect?

Todd Bradley TBradley at jabber.com
Mon Apr 9 12:56:14 CDT 2001

There's nothing special about that sequence.  My JabberBot, for instance,
sends a single \r every 30 seconds to keep its connection with the server
alive.  You could probably only send the "stay awake" reminder every few
minutes and still get away with it.  I agree the TCP keepalive on the server
might be more elegant, but this is easier.

-----Original Message-----
From: Jens Alfke [mailto:jens at mac.com]
Sent: Monday, April 09, 2001 11:45 AM
To: jdev at jabber.org
Subject: Re: [JDEV] Detecting client/server disconnect?

On Friday, April 6, 2001, at 03:40 PM, Oliver Jones wrote: 

Winjab works around this problem. It sends, once a minute, the five byte
no-op message 

space space tab space space 

to the server. This keeps the flow open. In xml terms, this message is
formally a noop; very cool. 

This is a clever hack! Is there something magic about "space space tab space
space" or would any whitespace sequence work? 

On the other hand, using TCP keepalive seems more efficient, since
responding to pings would involve only the TCP stack on the server and not
the Jabber server process itself. If you imagine a server with 10,000
simultaneous connections, there are going to be 167 of these pings a second,
so efficiency becomes important... 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20010409/01613390/attachment-0002.htm>

More information about the JDev mailing list