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

Pantelis Theodosiou ypercube at gmail.com
Fri Sep 10 15:09:17 EDT 2010

On Fri, Sep 10, 2010 at 7:55 PM, belk Dj <d_belkhiter at 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

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.


> 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 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/20100910/7848c316/attachment-0001.htm 

More information about the Twisted-Python mailing list