[Twisted-Python] How can a tcp client connect with multi servers?

Hi Xu,
How did you solve this problem? I face a similar issue and would appreciate if you post a working sample code
Thanks, Khoa

hi, I use a pool for connect task, and recall it in some seconds. I write some simple codes below to explain my idea, but i have not run it, so just read it do not run it:)
from Queue import Queue
TaskQueue = Queue()
def sendTcp(addr, port, message): global TaskQueue TaskQueue.put((addr, port, message))
def __send(): global TaskQueue while not TaskQueue.empty(): addr, port, message = TaskQueue.pop() reactor.connectTCP(addr, port, FooFactory(message))
reactor.callLater(15, __send)
if __name__ == "__main__": reactor.callLater(15, __send) reactor.run()
I'm appreciate to listen any advice On 12/12/05, Khoa Nguyen khoa.coffee@gmail.com wrote:
Hi Xu,
How did you solve this problem? I face a similar issue and would appreciate if you post a working sample code
Thanks, Khoa _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Xu Ryans
participants (2)
-
Khoa Nguyen
-
Xu Ryan