[jdev] XEP-0199 (XMPP Ping) to test reliability

Tomasz Sterna tomek at xiaoka.com
Tue Jan 22 07:48:04 CST 2008

On Pn, 2008-01-21 at 19:34 +0100, Yann Leboulanger wrote:
> > Not really. It's pretty verbose. We generally prefer to send
> whitespace 
> > over the TCP connection. We usually call that "whitespace ping".

I thought "keepalives" is a more common name. :-)

> That won't inform us if connection is brocken or server is down as
> those whitespace ping don't receive a pong ...

Not fully true.
You really do not receive "pongs" at the application level, but you
really do not need to.

Every sent TCP packed is ACK'ed on the TCP level. If it isn't ACKed it
is resent a few times until a timeout is reached and the broken
connection is signalled to the application level.
Other option is immediate detection of broken connection by receiving
NACK. This also is signalled to the application level.

This is all going "under the hood" and there is no reason to reimplement
it at again at application level. The TCP layer implementation is
usually very effective.
You may want to tune the timeout values though, but most modern OSes
have it set up at reasonable defaults.

  /\_./o__ Tomasz Sterna
 (/^/(_^^' http://www.xiaoka.com/
._.(_.)_   im:smoku at xiaoka.com

More information about the JDev mailing list