[Twisted-Python] No connectionLost

Glyph Lefkowitz glyph at twistedmatrix.com
Fri Dec 5 19:25:27 EST 2003

Ed Young wrote:

> Is this expected behavior?

Yep.  TCP is weird that way.  If you waited long enough you probably 
would have gotten the connectionLost to happen.

 > What can I do to avoid this problem?

Use a protocol that has keep-alive packets.  If you send data over the 
connection every so often and require that it comes back in a certain 
amount of time, you can terminate the connection if the link gets 
unacceptably unresponsive.

Alternatively, call self.transport.setTcpKeepAlive(True) from your protocol.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 256 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031205/128e3b72/attachment.pgp 

More information about the Twisted-Python mailing list