Jump to content
  • Advertisement
Sign in to follow this  
danieliskogen

Bidirectional SDL_net TCP

This topic is 3564 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 everyone! This is my first post here. I'm currently making small game/project which atm is just two sprites in a tile map. One sprite is controlled by the local player, and the other by a remote player. So the idea basically is: - Send local player's coordinates - Receive remote player's coordinates Pretty much your run of the mill newbie first attempt network game =) Atm, client sending data to server works fine, but as soon as I try to send something back, the game freezes. I guess it's because both server and client is stuck waiting for data with SDLNet_TCP_Recv(). What are my options here? Someone game me a tip having a thread receiveing data, so I tried a bit with SDL threads, but I had problems since SDL threads (threads in general?) and classes don't go well togehter. All my networking methods are in a class, so I need the thread to be a class member. Are there any other ways to get around this, or is the thread idea the only one? Thank you in advance. - Daniel

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!