10.05.2016, 05:57
Quote:
tcp is like high level programming.. you do stuff super easy but the underlying code can go fucked anytime because of some hillbilly issues
udp is like machine level programming.. you do some hardcore stuff but then u can directly communicate with the machine so you're in full control of everything that goes in n out |
The main 'disadvantage' of TCP is that it ensures that all packets arrive, and in order. This means that if some packets go missing, or if the packets arrive out of order, you will basically not receive any updates about the game until the missing packets have been retransmitted and have arrived. Other possible disadvantages when it comes to online gaming is that TCP is fair sharing (it fairly shares the available bandwidth with other TCP connections) and its congestion avoidance (which can cause packets to arrive out of order).
UDP, in the other hand, just sends the packets as a large burst. It uses as much bandwidth as it can, not caring about other applications using the same connections and it doesn't care about the packets after they have been sent. Whereas TCP would be dead set on retransmitting all the information you did not receive, UDP will simply not care (the information is 'out of date' anyway, so in an online game it's as good as useless), it will just send you the newest information.