[Twisted-Python] Cancel a Deferred timeout

Thomas Heller theller at python.net
Wed Feb 12 11:21:51 EST 2003

I'm currently doing my first steps with twisted, and I have a

I've started hacking the EchoClient example to connect to a small
embedded TCP server with a custom protocol I have here.

The server sends a line-feed 3 times a second, and when the client
doesn't receive them for one second or more, it must assume the
connection is broken and it should close the connection immediately
(and try to reconnect).

I thought using a deferred for this with a timeout of one second,
which will close the connection if the timeout callback is called.  If
the line-feed is received, the deferred timeout must be canceled, and
a fresh one set up. How can I do this?



More information about the Twisted-Python mailing list