Python Forum

Full Version: udp
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
has anyone here done any python programming of udp (user datagram protocol) or of any applications (written in python) that stack their protocol on udp? ... even if it uses a module to do the network code (hopefully the module is in python and distributed as .py files)?
If you have written anything for DNS, DHCP, SNMP, etc. you have (or at least should have) worked with UDP. If you require a fast service, with very little error checking, no response required from the receiving end and no need for ordered packets, then UDP is the way to go.

I'm not sure, as I've never used Pythons 'socket' library, but would imagine it has a way to deal with UDP.
Yes, socket module can deal with the datagram protocol.
but have you done any udp programming?
No. I didn't need such a program so far.
i was curious if anyone has run into problems with UDP other than the expected (lost datagrams, duplicate datagrams, out of order datagrams, significantly lagged datagrams) and in particular problems that might be Python specific (inconsistent data types, strange exceptions, bytes vs. strings issues).

one component i plan to make is a datagram relay program. it would be given a host (optional) and port to receive from and a host (optional) and port to send to. when a datagram is received, it is sent on to the designated location (which may be back to the source host). i have already done this kind of thing in C and with the socat program (a fantastic tool). i now have ideas i want to add on to that which are out of scope for socat. if i were not doing Python coding these days, i'd be doing this in C. but it makes more sense to do it in Python.