[Twisted-Python] Dual Reactor Script

Christopher Armstrong radix at twistedmatrix.com
Thu Oct 30 07:27:23 EST 2003

On Wed, Oct 29, 2003 at 10:26:42PM -0000, Mark Evans wrote:
> Now the Twisted Matrix samples I've examined all do this
> in their main entry:
>    reactor.listenTransport(port, protocolFactory)
>    reactor.run()
> However I have TWO transports and TWO protocols.  So the

Just call reactor.listenFoo twice. No threads, or any garbage like
that. The reactor can handle an arbitrary[1] number of listeners and

[1]: Some reactors, like win32eventreactor (which *isn't* used by
default, on Windows: SelectReactor is), have arbitrary limits. I think
you can only have 64 connections in that one, or something like that.

 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/

More information about the Twisted-Python mailing list