sdlNetCheckSockets function

int sdlNetCheckSockets(
  1. Pointer<SdlNetSocketSet> set,
  2. int timeout
)

Check a socket set for data availability.

This function checks to see if data is available for reading on the given set of sockets. If 'timeout' is 0, it performs a quick poll, otherwise the function returns when either data is available for reading, or the timeout in milliseconds has elapsed, whichever occurs first.

\param set the socket set to check for ready sockets. \param timeout the time to wait in milliseconds for new data to arrive. A timeout of zero checks for new data and returns without blocking. \returns the number of sockets ready for reading, or -1 if there was an error with the select() system call.

\since This function is available since SDL_net 2.0.0.

extern DECLSPEC int SDLCALL SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout)

Implementation

int sdlNetCheckSockets(Pointer<SdlNetSocketSet> set, int timeout) {
  final sdlNetCheckSocketsLookupFunction = libSdl2Net.lookupFunction<
      Int32 Function(Pointer<SdlNetSocketSet> set, Uint32 timeout),
      int Function(
          Pointer<SdlNetSocketSet> set, int timeout)>('SDLNet_CheckSockets');
  return sdlNetCheckSocketsLookupFunction(set, timeout);
}