Simple UDP server

Nick Craig-Wood nick at craig-wood.com
Wed Sep 10 20:36:32 EDT 2008


Tzury Bar Yochay <Afro.Systems at gmail.com> wrote:
>  I am looking for the right way to write a small and simple UDP server.
> 
>  I am wondering between Forking, Threading (found at SocketServer.py)
>  and the one describes at the snippet below.
> 
>  Can you tell me the advantages and disadvantages of each
>  Would the one below will be capable of holding 30 concurrent
>  connections?
> 
>  I have no intention of using Twisted or alike since I am looking for
>  making it as lightweight as possible

For UDP I wouldn't thread or, fork, I'd use select and run
asynchronously.

  http://docs.python.org/lib/module-select.html

Actually if I really had to do this I'd use twisted.  Right tool for
the job!

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list