[jdev] XMPP Ping/Keepalive: Recommended method ?

Joe Hildebrand hildjj at gmail.com
Mon Jun 26 21:58:03 CDT 2006


On Jun 19, 2006, at 1:15 AM, Sergei Golovan wrote:

> The problem is that this "ping" is not a ping at all because it only
> sends data and does not expect reply.

Well, not really.  You'll get a TCP ack back, which should be enough  
to keep the lights on.  Some servers can also be configured to send  
space keep-alives.  If both sides use this algorithm things seem to  
work pretty well:

1) set a timer to some amount of time, say 30 seconds
2) when the timer fires, send a space
3) whenever you send something, reset to the timer to zero
4) whenever you receive something, reset the timer to zero

this allows you to detect dead links about as quickly as possible,  
without increasing network traffic any more than absolutely necessary.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1883 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20060626/32d76bdb/attachment-0002.bin>


More information about the JDev mailing list