[Twisted-Python] How to detect dead client connections in twisted
adelagon at gmail.com
Sun Jun 1 22:41:33 EDT 2008
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:
from twisted.internet import protocol
from twisted.internet import reactor
print "Client Connected Detected!"
def connectionLost(self, reason):
print "Client Connection Lost!"
def dataReceived(self, data):
factory = protocol.Factory()
factory.protocol = EchoProtocol
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!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python