Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+21 votes

Back in the day when I played StarCraft on battlenet and locally I would select how I would connect to other players. For local I used UDP, listening to the videos now I can see why I used UDP. It is apparently faster than TCP though lacks guarantees. Clearly it worked without the guarantee so I wonder what the danger of UDP is?

so for clarity my question is, "What is the danger of sending a packet without a guaruntee? If the danger is tolerable why is the slower TCP used? What are examples of UDP failures in gaming or other packet use?"

Thanks for your input.

asked in CSC335_Spring2019 by (1 point)

1 Answer

+10 votes
 
Best answer

Presumably your local network was fairly reliable, and few packets would actually get dropped. When sending packets long distances across the internet, the chances of a packet getting lost are higher.

(Also, in a game, if the packets are saying "Unit A is at location (x,y)", then if you miss one packet, the next packet may provide the new (x,y) location, so a couple of dropped packets might be acceptable. The consequences of dropping packets during a financial transaction would be more serious...)

answered by (5.7k points)
selected by
...