[JDEV] Heartbeat patch for dialup and laptop users and faulty presence info

David Waite mass at akuma.org
Wed May 29 13:27:04 CDT 2002


Nathan Sharp wrote:

> admin at jabber.fsinf.de wrote:
>
>> Well, in case anyone has a better idea he is free to contribute. For the
>> time being your solution seems okay especially for it does not need
>> protocol or client changes.
>>
> Just a quick note here.  The solution I submitted as a patch is a PING 
> only solution, which is good because I can implement it now w/o 
> protocol or client changes, although it still has a 10-20 minute 
> window for noticing disconnects.  The solution I'm proposing is a 
> PING/PONG solution which will require changes to both the protocol and 
> clients in order to be useful.  I do plan, however, to make it an 
> optional feature for the client (i.e. the server can deal w/ older 
> clients).  I'm taking note of all this input and will work up a design 
> document when I get a chance (may take a while, maybe not, just 
> depends on my spare time...).

I do think you can do an optional ping/pong solution - if the client 
does not indicate in some manner they support it, fall back to the 
whitespace manner. They don't get reported offline as quickly.

>> Even with your patch messages may get lost. One should implement sending
>> of an error message or offline storage of the message that failed (if
>> possible).
>>
> Unfortunately, unless the protocol is changed such that the client 
> sends an acknowledgement of receiving a message (this is unlikely to 
> happen), there is no way to capture the lost packets.  The way TCP/IP 
> is implemented, any data that is queued up in the send buffers 
> (possibly on remote computers, remember), is just lost once the 
> connection is noticed as dead.  There is really no way to know the 
> difference between a packet that made it through just before the 
> disconnect to one that didn't make it through just after a disconnect 
> (in my knowledge, which is probably incomplete).  That is one more 
> reason that it is important to notice quickly when a client disconnects. 

Right; TCP acknowledges receipt by the remote operating system, not by 
the remote application. So you have edge cases where the remote system 
gets the message and processes it without receiving an acknowledgement 
back, and where you get an acknowledgement back but the remote 
application never processes the message (for instance, due to an 
application crash relating to the contents of the message).

-David Waite




More information about the JDev mailing list