[JDEV] Detecting client/server disconnect?

Robert Temple robert.temple at dig.com
Sat Apr 7 00:30:42 CDT 2001

This has been an minor issue for us.  People think they are connected 
or they think someone else is connected but really their socket connection 
was severed and the client and/or the server don't know about it.  It
sure would be nice if this was fixed in the protocol.  I'm not sure how
something like this would be backwards compatible...  Is that important at
this stage?


-----Original Message-----
From: Oliver Jones [mailto:oj at world.std.com]
Sent: Friday, April 06, 2001 3:41 PM
To: jdev at jabber.org
Subject: Re: [JDEV] Detecting client/server disconnect?

At 09:58 AM 4/6/01 -0700, Jens wrote:
>How does the Jabber protocol deal with the unexpected disconnection of a 
>client or server? I'm referring not to a process crash, but to unlikely 
>situations like kernel panic or power failure, as well as more likely ones 
>like network failure (modem hangs up, PacBell's DSL network horks, laptop 
>moves out of 802.11 range, baby yanks out Ethernet plug, etc.)

Far as I can tell, this is a problem with Jabber at the architecture 
level.  A very common source of this kind of disconnect is loss of the 
"flow" through a NAT (ipmasq) box interfacing an office LAN to the public 

Winjab works around this problem.  It sends, once a minute, the five byte 
no-op message
    space space tab space space
to the server.  This keeps the flow open.  In xml terms, this message is 
formally a noop; very cool.

We got into a jam here because a custom client I and my colleagues 
developed didn't send this message.  I fixed this without requiring updates 
of the client in the field by hacking jpolld to send the keepalive message 
from the server to the client.  Works great.

>Some other presence protocols solve this by requiring the client to send a 
>"noop" or "ping" command every few minutes, which the server must respond

Well, Winjab has the keepalive message, but I don't think the jabber 
session-layer architecture says you HAVE to have it.  (Correct me if I'm 
wrong, Jabber mavens!)

I think the session-layer architecture SHOULD require keepalive. For one 
thing, on a highly scaled-up system the connection ports are a scarce 
resource.  A keepalive message in the architecture would allow a server to 
free up ports for clients that had gone out to lunch in the ways you

Ollie Jones

jdev mailing list
jdev at jabber.org

More information about the JDev mailing list