[Twisted-Python] BUG: setting timeout on clientTCP() will invoke connectionFailed twice
Ivo van der Wijk
ivo at amaze.nl
Sat Jun 15 09:50:55 EDT 2002
Hi,
The following code:
--
from twisted.protocols.http import HTTPClient
from twisted.internet import reactor
class foo(HTTPClient):
def connectionFailed(self):
print "Failed"
reactor.clientTCP("localhost", 8888, foo(), 2)
reactor.run()
--
Will print "Failed" twice. Without the timeout, only one "Failed" will be
printed (of course make sure you connect to something that fails immediately
when testing this :)
It's kind of silly to keep te timeout after the connection has already
failed - it should be cancelled, right?
Cheers
Ivo
--
Drs. I.R. van der Wijk -=-
Brouwersgracht 132 Amaze Internet Services V.O.F.
1013 HA Amsterdam, NL -=-
T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase
W http://www.amaze.nl E info at amaze.nl Network Solutions
W http://vanderwijk.info E ivo at amaze.nl Consultancy
PGP http://vanderwijk.info/pgp -=-
More information about the Twisted-Python
mailing list