Sign in to follow this  

using TCP & UDP together

This topic is 4380 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I remember reading in a old thread on this forum about using TCP and UDP concurently. There where some potential problems you could run in to when using both a TCP socket for reliable in order messages and UDP for unreliable updates in the same game. Does anyone know more about this? And if it doesn't cause any problems, why would anyone bother using a reliable protocol wrapped around UDP like Enet?

Share this post


Link to post
Share on other sites
On a modem or another narrow channel (like the uplink of a cable or DSL connection), large TCP fragments may cause excessive jitter for UDP packets.

Also, on the server side, you need one TCP socket per connected client, whereas you only need a single socket for all UDP communications. If you want to host a lot of players, you'll start using more and more CPU for managing the sockets in the networking stack -- you may want to use that CPU for something else.

TCP does not, in general, work with NAT punch-through set-ups; i e, your server must be on a publicly visible IP address.

Those are the biggies. If neither is a problem for you, then there's no reason you can't use TCP and UDP at the same time.

Share this post


Link to post
Share on other sites

This topic is 4380 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this