[Twisted-Python] Client to deal with multiple servers (Multiple Reactors?)

Hi, I am new to twisted and I am trying to implement a simple client that needs to deal with several servers (windows platform). I would like to send from the client asynchronous requests to all the server, using TCP I think that a solution would be to use a reactor per server connection in the client, but that does not seems possible as the reactor is a singleton. Could some one give me an idea of how i can deal with this? Thank You Miguel Sanches

On 7/14/06, Hermínio Miguel Sanches <hsanches@gmail.com> wrote:
No, you don't use multiple reactors, you use one reactor and simply call connectTCP multiple times. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/

Many Thanks Christopher for the quick answer I was missing the point with two basic errors: 1) trying to connect multiple times(n) using reactor.connectTCP() with (n) calls to reactor.run() 2) trying to instantiate only once the pb.PBClientFactory() for different calls to reactor.connectTCP() What I did was: 1) call only once reactor.run() after launching all the callbacks 2) instantiating pb.PBClientFactory() each time before a call to reactor.connectTCP() (to change the server) Please advise if I am doing something wrong. Cheers Miguel On 7/14/06, Christopher Armstrong <radix@twistedmatrix.com> wrote:

On 7/14/06, Hermínio Miguel Sanches <hsanches@gmail.com> wrote:
Many Thanks Christopher for the quick answer
No worries.
That looks right. Is everything working well? -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/

Yes everything seems working fine but I am still at the beginning and I will continue my digging phase and with the fast replies that I've just received, leaves me with no big worries trying to use twisted. Thanks Miguel On 7/14/06, Christopher Armstrong <radix@twistedmatrix.com> wrote:

On 7/14/06, Hermínio Miguel Sanches <hsanches@gmail.com> wrote:
No, you don't use multiple reactors, you use one reactor and simply call connectTCP multiple times. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/

Many Thanks Christopher for the quick answer I was missing the point with two basic errors: 1) trying to connect multiple times(n) using reactor.connectTCP() with (n) calls to reactor.run() 2) trying to instantiate only once the pb.PBClientFactory() for different calls to reactor.connectTCP() What I did was: 1) call only once reactor.run() after launching all the callbacks 2) instantiating pb.PBClientFactory() each time before a call to reactor.connectTCP() (to change the server) Please advise if I am doing something wrong. Cheers Miguel On 7/14/06, Christopher Armstrong <radix@twistedmatrix.com> wrote:

On 7/14/06, Hermínio Miguel Sanches <hsanches@gmail.com> wrote:
Many Thanks Christopher for the quick answer
No worries.
That looks right. Is everything working well? -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/

Yes everything seems working fine but I am still at the beginning and I will continue my digging phase and with the fast replies that I've just received, leaves me with no big worries trying to use twisted. Thanks Miguel On 7/14/06, Christopher Armstrong <radix@twistedmatrix.com> wrote:
participants (3)
-
Christopher Armstrong
-
David Pratt
-
Hermínio Miguel Sanches