ejabberd - Comments for "Behavior when terminating a connection" https://www.ejabberd.im/node/3749 en > Does this also happen if a https://www.ejabberd.im/node/3749#comment-54909 <p>&gt; Does this also happen if a client closes a stream without sending ?</p> <p>I think yes, because the client closes the TCP connection, and Erlang/ejabberd detects it.</p> <p>&gt; it would be best if there is an inactivity timer before a client is set to 'offline'.</p> <p>In the paper, this seems a good idea. But it might not prove good in practice, so it would need to be considered further.</p> <p>On the other hand, at first look this doesn't seem easily implementable, because when the TCP connection is closed Erlang detects it and ejabberd stops the related C2S process. It would need some research to see if it's possible to:</p> <ol> <li>When client closes TCP connection without closing stream, keep the c2s process in "zombie" state. </li><li>If user relogins using a new TCP connection and the same resource, "re-attach" the new TCP connection to the "zombie" C2S ejabberd process. </li><li>The zombie process dies if it isn't relived in less than X seconds. In that case send offline presence broadcast to contacts. </li></ol> <p>This may be related: <noindex><a href="https://support.process-one.net/browse/EJAB-430" title="https://support.process-one.net/browse/EJAB-430" rel="nofollow" >https://support.process-one.net/browse/EJAB-430</a></noindex></p> Mon, 16 Nov 2009 23:17:53 +0000 mfoss comment 54909 at https://www.ejabberd.im