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

Hermínio Miguel Sanches hsanches at gmail.com
Fri Jul 14 09:49:29 EDT 2006

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.



On 7/14/06, Christopher Armstrong <radix at twistedmatrix.com> wrote:
> On 7/14/06, Hermínio Miguel Sanches <hsanches at gmail.com> wrote:
> > 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.
> 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/
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20060714/5a61af90/attachment.htm 

More information about the Twisted-Python mailing list