• Advertisement
Sign in to follow this  

SDL_net - Checking for incoming data

This topic is 4343 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

Is there a way to check if there is any incoming data on a socket? I read on another thread that SDLNet_TCP_Recv() will sit and wait if there is no incoming data. Does anyone know of a way to check if there is any incoming data before calling SDLNet_TCP_Recv()?

Share this post


Link to post
Share on other sites
Advertisement
Check out the parts on 'Socket Sets' in the SDL_net documentation. The functions provided can go through and check all of the sockets in a set for you and determine which have data ready to be processed, to avoid having a blocking delay when reading from a socket.

If you're Pascal-savvy, I found an example that shows some of its basic usage. I'm sure you'll be able to Google up some C/C++ ones if that's not of use, though. :)

Good luck!

Share this post


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

  • Advertisement