Sign in to follow this  

Two way TCP with SDL_net

Recommended Posts

Vaclav    147


I use the code from the following great tutorial:

But I can send only from the client to the server. Can you help me what do I have to add the code to send from the server to the client? Do I have to create another socket, or I can use that one already open? Note that I need only one client per server, so I want just something simple.

Thank you,


Share this post

Link to post
Share on other sites
SimonForsman    7642

You can just write to the same socket you read from. (csd in the tutorial example), to support multiple clients you just have to keep calling accept on the main socket (sd in the tutorial) and store the sockets it returns in a list.

Share this post

Link to post
Share on other sites

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