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

Fabio Forno fabio.forno at gmail.com
Wed Jan 23 08:25:31 CST 2008

On Jan 22, 2008 2:48 PM, Tomasz Sterna <tomek at xiaoka.com> wrote:
> 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.

Indeed there are few reasons. At application level you usually don't
block on the write, but the OS queues data to an outgoing buffer,
making you believing that data was sent. If the connection is broken
the application gets an error only when sending a further packet (or
packets if the buffer isn't full), but it has no knowledge where the
previous stanza was actually received or not. XEP-198 and a BOSH
transport instead allow preventing these situations.

Fabio Forno, Ph.D.
Bluendo srl http://www.bluendo.com
jabber id: ff at jabber.bluendo.com

More information about the JDev mailing list