Jump to content

  • Log In with Google      Sign In   
  • Create Account


Two way TCP with SDL_net


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Vaclav   Members   -  Reputation: 136

Like
0Likes
Like

Posted 23 April 2013 - 02:45 AM

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



Sponsor:

#2 SimonForsman   Crossbones+   -  Reputation: 5476

Like
0Likes
Like

Posted 23 April 2013 - 05:02 AM

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.


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!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS