Hello,
I am in vacation, and should not be hacking on anything, but some how I
keep having trouble with twisted :)
tcp.Client calls self.failIfNotConnected in two ways, via
reactor.callLater with a timeout and in resolveAddress when it can't
resolve the address.
The problem is, that when resolveAddress can't resolve the address, it
calls self.failIfNotConnected and later when the timeout is reached and
self.failIfNotConnected called again, the socket is still not
connected, so my connectionFailed method gets called twice which I
don't think is right.
I see two fixes for this:
- Keep the return value of callLater and cancel it on
self.failIfNotConnected.
- Use some flag variable so self.failIfNotConnected knows that it
already called connectionFailed and it doesn't do it again on the
timeout.
Thanks
ranty
--
--- Manuel Estrada Sainz <ranty(a)debian.org>
<ranty(a)bigfoot.com>
<ranty(a)users.sourceforge.net>
------------------------ <manuel.estrada(a)hispalinux.es> -------------------
God grant us the serenity to accept the things we cannot change, courage to
change the things we can, and wisdom to know the difference.