Skip to content

Should we use UDP or TCP for network communication, and what’s the difference in the context of a game like this??? #43

Answered by kh3rld
kherldhussein asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kherldhussein
Comment options

kherldhussein Aug 26, 2024
Collaborator Author

@kh3rld
Comment options

Answer selected by kherldhussein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants