[Twisted-Python] i want to update 1000 devices running as servers

Luka Rahne luka.rahne at gmail.com
Fri Jul 20 08:55:59 MDT 2012


Thank you
It was needed to call self.transport.stopListening() and i updated new
client whit working code and now it works much better.

https://gist.github.com/3144857/d0446f8654326c93a5e9def0b6c9172351494219

and old code i was referencing to is here (just for reference)

https://gist.github.com/3144857/5a38e287dec7c480ad34e5073ae1773b95a86662



2012/7/20 Itamar Turner-Trauring <itamar at itamarst.org>:
>
> On 07/20/2012 04:26 AM, Luka Rahne wrote:
>> for each line in sx:
>>      encode line whit extra data in packet (packet is like len + encrypted_)
>>      Send packet over UDP (tcp not supported)
>>      wait for ACK ("OK" packet in my example)
>>      wait for 0.05 s (not in included example)
>>
>>
>> I done some code that should support this and i have tried to stop
>> protocol but calling self.doStop()  function
>> (twisted.internet.protocol.AbstractDatagramProtocol)    raises assert
>> assert self.numPorts > 0
>>
>> I was hoping that this function will remove protocol instance from reactor.
>>
>
> You can do:
>
> port = reactor.listenUDP(....)
> port.stopListening() # disconnect port
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list