[Twisted-Python] Non-list expression received, 'Server' object has no attribute 'socket'

Itamar Shtull-Trauring itamar at itamarst.org
Fri Dec 2 11:41:01 EST 2005

On Fri, 2005-12-02 at 14:28 +0000, Alex Couper wrote:

> def run(self):  
>         while 1:
>             application = service.Application("copy_receiver")
>             internet.TCPServer(8800,
> pb.PBServerFactory(self)).setServiceParent(
>                 service.IServiceCollection(application))      
>             self.listener = reactor.listenTCP(8800,
> pb.PBServerFactory(self))
>             #installSignalHandlers=0 allows the reactor to run in a
> non-main thread 
>             reactor.run(installSignalHandlers=0)

This is wrong. You can only call reactor.run() *once* in your program's
lifetime. reactor.run() only exits when someone calls reactor.stop();
since you don't want it to finish, don't call reactor.stop() until you
need it to.

More information about the Twisted-Python mailing list