[Twisted-Python] UDP with multiple connections

Carl Zmola zmola at acm.org
Thu Oct 11 22:42:22 EDT 2007


I would like to make a general comment about the use of UDP in 
applications.  There are some people on this list who can do some tricky 
things with UDP, but as a general rule, what should be recommended is 
"use TCP".  If you end up running into issues that TCP has problems 
with, there are other options, but you should have tried TCP first.  If 
you are asking advise on this forum on using UDP, the first reply should 
always be: "Why arn't you using TCP?", and the second reply should be 
"Have you actually tried TCP and seen problems with it?"

UDP is fun and if you know what you are doing, you can get some benefits 
out of it, but you have to put an awful lot of work into it and I have 
seen many cases where the promised benefits of using UDP are not seen.


Areas where UDP can give some benefits are:
  Overcoming latency due to a 3way handshake,
  reducing cost if you are charged by the byte (but this can be eaten up 
by development cost and retransmission),
  multicast (but you then need to have control over your network).

I have heard of at least one case where large UDP applications have been 
put in due to the perceived benefits, only to be replaced by a TCP 
application that actually works.

--
Carl
zmola at acm.org




More information about the Twisted-Python mailing list