SDL_net - Checking for incoming data
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!
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!
--Gauntlets of Recursion (+3) - My game development journal.My Recent Projects: [Meteorites] [Gundown] [Magma Duel] [Admiral Overalls] [Membrane Massacre]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement