TCP
Cause:
TCP: "There is an absolute guarantee that the transmitted data remains intact and arrives in the same order in which it was sent."
UDP: "There is no guarantee that sent messages or packets will be available at all."
Find out more: http://www.diffen.com/difference/TCP_vs_UDP
Would you like to lose your chat message?
Change I missed part of the "great chat program." I think that due to the nature of the chat program, it should be a TCP server, I can’t imagine the actual text content sent by users via UDP.
The maximum limit for TCP servers is 65,536 connections at a time. If you really need to go through this number, you can create a dispatch server that will send incoming connections to the appropriate server depending on the current server loads.
source share