[jdev] XMPP Ping/Keepalive: Recommended method ?

Michal vorner Vaner michal.vaner at kdemail.net
Mon Jun 19 02:04:18 CDT 2006


On Sun, Jun 18, 2006 at 10:47:19PM -0700, ennova2005-jabber at yahoo.com wrote:
>    Given that the protocol itself does not seem to have a defined keep-alive
>    element, what is the recommended way for a client to keep its connection
>    alive to a XMPP server ?

Since XML allows any number of whitespace between elements that is just
ignored, you can send a whitespace if you are not in the middle of
stanza. It will do, NATs and other beasts will see data flowing,

>    Can someone provide an exact wire representation of the "space keep alive"
>    method that will not break current xmpp servers  ? ( I tried to observe
>    the debug output of a couple of popular xmpp clients without much luck)

That thing is already preparsed and nicely formated into lines. As
whitespace is ignored, it is not there.

>    This is for an ad-hoc client that open a raw tcp socket and sends a few
>    things ( it is not using a full xmpp client library)   There is only one
>    instance of this client so we were otherwise thinking of using
>    jabber:iq:time or jabber:iq:version
> 
>    Are there other low overhead no-op packets we could be sending instead ?
>    At the moment I am interested only in sending some valid traffic for this
>    purpose (and not quite looking for  a valid response as long - as it does
>    not terminate the connection)

-- 
One semi-random fortune:

Einstein argued that there must be simplified explanations of nature, because
God is not capricious or arbitrary.  No such faith comforts the software
engineer.
                -- Fred Brooks

Michal "vorner" Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20060619/e3339da0/attachment-0002.pgp>


More information about the JDev mailing list