[Twisted-Python] Problem with ClientFactory

Itamar Shtull-Trauring itamar at itamarst.org
Wed Jan 26 11:43:29 EST 2005

On Wed, 2005-01-26 at 16:57 +0100, Michal Chruszcz wrote:

> class Factory(ClientFactory):
>     protocol = Protocol
>     def startedConnecting(self, connector):
>         print "Connecting..."
>     def buildProtocol(self, addr):
>         print "Connected."

The problem is you overrode buildProtocol. Default buildProtocol returns
self.protocol(), but if you override it you need to create and return a
protocol instance yourself.

More information about the Twisted-Python mailing list