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

2012-07-20 Thread Luka Rahne
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/

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

2012-07-20 Thread Luka Rahne
My current problem is, that i do not know how to stop protocol and quit listening. What should i call to stop protocol and told reactor to remove from schedule at StopIteration exception? About while 1: loop- that loop is there just to find first non empty line in sx file, in most case it break

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

2012-07-20 Thread Itamar Turner-Trauring
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 d

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

2012-07-20 Thread exarkun
On 07:01 am, luka.ra...@gmail.com wrote: >I have like 1000 devices that need update that takes like 1 minute >each. I >want them to update as quick as possible, sending lines from sx file, >using >UDP and for each line i got reponse "OK". > >Here is code that works for up to 500 servers, but not

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

2012-07-20 Thread Luka Rahne
Due to historical reasons there is UDP only protocol whith response ack for each packet. In reality there are also some delays because received device can not handle data after it sends ack (some ancient and buggy eth chip). Also there are not just lines from sx file, but are enveloped in other pa

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

2012-07-20 Thread Laurens Van Houtven
What version of twisted are you using and which reactor is it using? (You can tell from the logs) Note that your process for getting data from the datasource is blocking. What sort of data source is it, and why are you stripping stuff off of it? You might want to consider something more coopera

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

2012-07-20 Thread Luka Rahne
I have like 1000 devices that need update that takes like 1 minute each. I want them to update as quick as possible, sending lines from sx file, using UDP and for each line i got reponse "OK". Here is code that works for up to 500 servers, but not so well when i go more (it just does not finish)