<br>I just recently discovered that it&#39;s a TCP half-open socket scenario that can be remedied by monitoring client heartbeats. This is not twisted related issue. Thanks anyway. :)<br><br>Alvin Delagon<br><br><div class="gmail_quote">
On Mon, Jun 2, 2008 at 10:41 AM, Alvin Delagon &lt;<a href="mailto:adelagon@gmail.com">adelagon@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;ve been using xmlstream for quite sometime now and I noticed one such problem where my server doesn&#39;t detect clients that went to hardware shutdown without closing the socket. I also reproduced it using a simple twisted TCP server:<br>

<br>#!/usr/bin/python<br>from twisted.internet import protocol<br>from twisted.internet import reactor<br><br>class EchoProtocol(protocol.Protocol):<br>&nbsp;&nbsp;&nbsp; def __init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass<br><br>&nbsp;&nbsp;&nbsp; def connectionMade(self):<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Client Connected Detected!&quot;<br><br>&nbsp;&nbsp;&nbsp; def connectionLost(self, reason):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Client Connection Lost!&quot;<br><br>&nbsp;&nbsp;&nbsp; def dataReceived(self, data):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.transport.write(data)<br>

<br><br>factory = protocol.Factory()<br>factory.protocol = EchoProtocol<br>reactor.listenTCP(8000, factory)<br>reactor.run()<br><br>Using a different machine, telnet to the echo server and then shut down the computer (without exiting telnet). It seems that the connectionLost function doesn&#39;t get called. I even had an XMPP account appeared online on our XMPP server for almost three days even though I shut down the PC hosting my client. Should we implement a Hearbeat functionality? Thank you in advance!<br>

<br clear="all">Alvin Delagon<br><font color="#888888"><br>-- <br><a href="http://www.alvinatorsplayground.blogspot.com/" target="_blank">http://www.alvinatorsplayground.blogspot.com/</a>
</font></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.alvinatorsplayground.blogspot.com/">http://www.alvinatorsplayground.blogspot.com/</a>