[jdev] XMPP Ping/Keepalive: Recommended method ?
dave at cridland.net
Mon Jun 19 10:03:44 CDT 2006
On Mon Jun 19 08:15:40 2006, Sergei Golovan wrote:
> On 6/19/06, Michal vorner Vaner <michal.vaner at kdemail.net> wrote:
>> 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
>> > alive to a XMPP server ?
>> Since XML allows any number of whitespace between elements that is
>> 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,
> The problem is that this "ping" is not a ping at all because it only
> sends data and does not expect reply.
> So, some NATs and proxies still break connection if they don't see
> bidirectional flow.
Could you tell me which NATs do this? I'm unaware of any that handle
timeouts differently for unidirectional data flows.
> Another issue is that with this "ping" you can't control the
> connection. If TCP connection breaks (but before TCP timeout
> reaches -
> and it is a quite long timeout)
As far as I'm aware, there *is* no timeout on silent TCP connections.
> both messages and "pings" goes to
> black hole and there's no way to work around this (to set some short
> internal timeout or whatever).
True, you need some acking mechanism to prevent this.
Dave Cridland - mailto:dave at cridland.net - xmpp:dwd at jabber.org
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade
More information about the JDev