Should we use UDP or TCP for network communication, and what’s the difference in the context of a game like this??? #43
-
Choosing between UDP (User Datagram Protocol) and TCP (Transmission Control Protocol) can impact the performance and reliability of network communication in the game. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I recommend sticking with TCP. IT ensures that all data packets arrive in order and without errors, which is important for turn-based games where every move needs to be processed in the correct sequence. UDP, on the other hand, is faster but doesn’t guarantee delivery or order, making it more suitable for real-time games where speed is critical, and some data loss is acceptable. If you’re interested, you can check out more about these protocols on MDN Web Docs. |
Beta Was this translation helpful? Give feedback.
I recommend sticking with TCP. IT ensures that all data packets arrive in order and without errors, which is important for turn-based games where every move needs to be processed in the correct sequence. UDP, on the other hand, is faster but doesn’t guarantee delivery or order, making it more suitable for real-time games where speed is critical, and some data loss is acceptable. If you’re interested, you can check out more about these protocols on MDN Web Docs.