[jdev] How is a client crash communicated to the XMPP server?

JabberForum list-jdev at jabberforum.org
Mon Jun 2 03:25:02 CDT 2008

I would like to discuss about what happens when an XMPP client crashes
and how this information is communicated to the server..

I have a server S and 2 clients C1 and C2 connected to the server. C1
has C2 in its roster list and C2 has C1 in its roster list. 

If C1 gracefully logs out, then an iq stanza of type unavailable is
sent to the server and the server broadcasts that stanza to all JIDs
which have a subscription of from or both.

However, I have been trying to search for what happens when the
client crashes (or exits ungracefully). I havent arrived at the answer
yet. Here is what RFC 3291 says : 

"5.1.5.  Unavailable Presence

Before ending its session with a server, a client SHOULD gracefully
unavailable by sending a final presence stanza that possesses no 'to' 
attribute and that possesses a 'type' attribute whose value is 
"unavailable" (optionally, the final presence stanza MAY contain one or

more <status/> elements specifying the reason why the user is no longer

available). *However, the user's server MUST NOT depend on receiving
presence from an available resource, since the resource may become 
unavailable unexpectedly or may be timed out by the server. If one of
user's resources becomes unavailable for any reason (either gracefully
ungracefully), the user's server MUST broadcast unavailable presence to

all contacts *(1) that are in the user's roster with a subscription
type of 
"from" or "both", (2) to whom the user has not blocked outbound
and (3) from whom the server has not received a presence error during
user's session; the user's server MUST also send that unavailable
stanza to any of the user's other available resources, as well as to
entities to which the user has sent directed presence during the user's

session for that resource (if the user has not yet sent directed 
unavailable presence to that entity). Any presence stanza with no
attribute and no 'to' attribute that is sent after sending directed 
unavailable presence or broadcasted unavailable presence MUST be 
broadcasted by the server to all subscribers. "

Do we interpret that as : "the server will 'somehow' know that the
client has crashed and then publish the unavailable stanzas to everyone
subscribed to that JID ?

Please clarify.. :-)


santhosh.kulandaiyan's Profile: http://www.jabberforum.org/member.php?userid=16912
View this thread: http://www.jabberforum.org/showthread.php?t=200

More information about the JDev mailing list