Check and wait for sockets in a set to have activity
the number of sockets with activity. -1 is returned on errors, and you may not get a meaningful error message. -1 is also returned for an empty set (nothing to check).
Binds to C-function call in SDL_net.h:
extern DECLSPEC int SDLCALL SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout)
// Wait for up to 1 second for network activity //SDLNet_SocketSet set; int numready; numready=SDLNet_CheckSockets(set, 1000); if(numready==-1) { printf("SDLNet_CheckSockets: %s\n", SDLNet_GetError()); //most of the time this is a system error, where perror might help you. perror("SDLNet_CheckSockets"); } else if(numready) { printf("There are %d sockets with activity!\n",numready); // check all sockets with SDLNet_SocketReady and handle the active ones. }
SdlNet Class | Tao.Sdl Namespace | SDLNet_SocketReady | SDLNet_AddSocket | SDLNet_DelSocket | SDLNet_AllocSocketSet | SdlNet.SDLNet_SocketSet | SdlNet.UDPsocket | SdlNet.TCPsocket