<br>I&#39;ve implemented a twisted server using the basic.lineReceiver class.&nbsp; The client is a socket based client implemented in flash and the connections are long-lived (minutes or hours).&nbsp; To handle cleaning up the players when they disconnect, I&#39;m using the connectionLost function in my player class.&nbsp; 99% of the time, things work as expected.<br>

<br>However in rare cases, connectionLost is not getting called when the flash-based client disappears.&nbsp; Even completely quitting the client&#39;s web-browser does not always trigger a connectionLost call.&nbsp; I tracked down one specific instance yesterday where the server thought the client was still connected even though the client had been gone for 30+ minutes--but after a few hours the server noticed that the client was gone and then connectionLost was called like normal.&nbsp; That made me think that it might be a problem on the server side and maybe not client related.<br>

<br>I&#39;m starting on a workaround now where the client will issue a &quot;PING&quot; every 30 seconds and the server will use the ping information to manually trigger loseConnection when needed.&nbsp; Are there a better workarounds for this, better practices or some error checking I can do to avoid these intermidant laggy connectionLost calls?<br>
<br>Thanks in advance.<br><br>Rob<br><br>P.S.&nbsp; I&#39;ve found twisted to have incredible performance compared to everything else we&#39;ve tried.&nbsp; If you&#39;re interested you can see the client at <a href="http://www.guessasketch.com/">http://www.guessasketch.com/</a> .&nbsp; I&#39;m happy to post server code excerpts if it would be helpful.<br>