Advertisement

SDL_net - Checking for incoming data

Started by April 04, 2006 06:56 PM
1 comment, last by thannett 18 years, 10 months ago
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()?
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!
Advertisement
This is great. Thanks a lot! ;)

This topic is closed to new replies.

Advertisement