<br>I just recently discovered that it'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 <<a href="mailto:adelagon@gmail.com">adelagon@gmail.com</a>> 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've been using xmlstream for quite sometime now and I noticed one such problem where my server doesn'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> def __init__(self):<br> pass<br><br> def connectionMade(self):<br>
print "Client Connected Detected!"<br><br> def connectionLost(self, reason):<br> print "Client Connection Lost!"<br><br> def dataReceived(self, data):<br> 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'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>