Two way TCP with SDL_net

Started by
0 comments, last by SimonForsman 10 years, 11 months ago

Hey,

I use the code from the following great tutorial:

http://content.gpwiki.org/index.php/SDL:Tutorial:Using_SDL_net

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,

Václav

Advertisement

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.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

This topic is closed to new replies.

Advertisement