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><br>-- <br><a href="http://www.alvinatorsplayground.blogspot.com/">http://www.alvinatorsplayground.blogspot.com/</a>