[Twisted-Python] ClientCreator error handling

Itamar Shtull-Trauring itamar at itamarst.org
Tue Mar 7 13:46:54 EST 2006


On Tue, 2006-03-07 at 19:19 +0100, Mike Christey wrote:
> 
> def errorCallback(failure):
>         print "Err"
>         [...] # other code
> 
> 
> 
> d = defer.Deferred()
> d.addErrback(errorCallback)
> protocol.ClientCreator(reactor, SimpleTransport).connectTCP(HOST, 
> 22)
> reactor.run() 

protocol.ClientCreator(reactor, SimpleTransport).connectTCP(HOST,
22).addErrback(errorCallback)

ClientCreator.connectTCP returns a Deferred.

-- 
Itamar Shtull-Trauring
http://itamarst.org






More information about the Twisted-Python mailing list