In games, most of the time there is an important decision that must be made: whether to use TCP or UDP. The decision often ends up in favor of UDP, but still it is important to understand the difference between the two.
In this recipe, we will find out how easy it is to make a decision on whether to use TCP or UDP.
Ask the following questions:
Does the system require guaranteed delivery?
Is there a requirement for retransmission?
Does the system require any handshaking mechanism?
What kind of congestion control does it need?
Is speed a consideration in the system?
TCP and UDP are built on top of the IP layer:
A TCP connection is considered reliable because there is a two-way handshake system enabled. Once the message is delivered to the endpoint, an acknowledgement message is sent out. It supports various other services as well, such as congestion control and multiplexing...