[Twisted-Python] reactor for both udp and tcp/ timer issue

I need to communicate with servers over tcp and also communicate with other servers over udp. It seems not possible to launch two reactor objects one for tcp and one for udp. The code after a reactor.run is not called. How can this can be solved ? One more thing that deals with timer. When i send a message to a server if after some time i don't get an acknowledge i re send the message. And that x times. To do that i use Timer. When i send the message i start the timer if the acknowledge comes before the timeout i cancel the timer. If i don't receive this acknwledge in time i cancel the timer i re send the previous message and i re start the timer. In this two cases the program fails with the message the timer is still started. What is the issue ? Regards

On Fri, Sep 10, 2010 at 7:55 PM, belk Dj <d_belkhiter@yahoo.fr> wrote:
I need to communicate with servers over tcp and also communicate with other servers over udp. It seems not possible to launch two reactor objects one for tcp and one for udp. The code after a reactor.run is not called. How can this can be solved ?
I'm not an expert in any way, but I've made something similar using 2 factories. I think that it is also possible with one factory that uses 2 protocols. The code after reactor.run() will be invoked only after the reactor stops. So, you can have 2 factories, each with a different protocol (1 tcp, 1 udp) and then start the reactor. Pandelis
One more thing that deals with timer. When i send a message to a server if after some time i don't get an acknowledge i re send the message. And that x times. To do that i use Timer. When i send the message i start the timer if the acknowledge comes before the timeout i cancel the timer. If i don't receive this acknwledge in time i cancel the timer i re send the previous message and i re start the timer.
In this two cases the program fails with the message the timer is still started. What is the issue ?
Regards
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (2)
-
belk Dj
-
Pantelis Theodosiou