[Twisted-Python] robust listenUDP with N clients?

marc bohlen marcbohlen at acm.org
Mon Dec 4 12:05:29 EST 2006


Jean-Paul Calderone wrote:
> On Mon, 04 Dec 2006 10:28:57 -0500, marc bohlen <marcbohlen at acm.org> 
> wrote:
>> hi folks
>>
>> I am new to twisted and new to server programming. Nonetheless, I 
>> would like to build a robust client-server looping mechanism in which 
>> a server would listen for input from N clients, say 10, and react 
>> immediately when it receives data from them. I have a sample (see 
>> below) that appears to run well, but am not sure if it will scale 
>> under real network load and larger N.
>> (I am parsing the input data received from the clients and using it 
>> to calculate a fibonnaci series, just for testing. The reactor can be 
>> stopped with keyboard input (I am on a win32 platform)).
>>
>> If you see any problems with this approach, please let me know !
>> Thanks, marc
>
> You probably need to be more specific to get many useful responses.  What
> do you expect N to go to?  Why do you use multiple ports?  Why are you
> using UDP?  What do you mean by "robust"?  What does the Fibonnaci 
> calculation
> have to do with the application?  Is the keyboard input handling code
> relevant or just part of the example?  Is win32 your development platform
> or your deployment platform or both?
>
> Jean-Paul
>

Hi Jean-Paul

I would want N no larger than 30.
I am testing only on localhost and have N ports instead of N computers for now.
Fibonnaci calculation: just a cpu cycle eating app for testing, will change.
Keyboard handling is important.
Win32 is development and deployment platform.
UDP choice: I would like the faster of the two protocols (UDP vs TCP), although TCP has congestion
control. Is TCP the better choice here?
Robust: will it work even under heavy network load


marc





More information about the Twisted-Python mailing list