Search code examples
pythonmultithreadingsocketsudptornado

Easiest Way to Perform Asynchronous Socket Reading from UDP in Python?


I am trying to find the easiest way to read from multiple (around 100) udp datagram sockets in python. I have looked at tornado, but tornado touts http/tcp rather than udp support.

Right now I have threads dedicated to each udp socket; however, this doesn't seem very efficient.


Solution

  • I must confess I never used it, but maybe Twisted will suit your needs.

    It supports lots of protocols, even serial connections.