sdlNetAllocSocketSet function

Pointer<SdlNetSocketSet> sdlNetAllocSocketSet(
  1. int maxsockets
)

Allocate a socket set for use with SDLNet_CheckSockets().

To query if new data is available on a socket, you use a "socket set" with SDLNet_CheckSockets(). A socket set is just a list of sockets behind the scenes; you allocate a set and then add/remove individual sockets to/from the set.

When done with a socket set, you can free it with SDLNet_FreeSocketSet.

\param maxsockets the maximum amount of sockets to include in this set. \returns a socket set for up to maxsockets sockets, or NULL if the function ran out of memory.

\since This function is available since SDL_net 2.0.0.

\sa SDLNet_FreeSocketSet

extern DECLSPEC SDLNet_SocketSet SDLCALL SDLNet_AllocSocketSet(int maxsockets)

Implementation

Pointer<SdlNetSocketSet> sdlNetAllocSocketSet(int maxsockets) {
  final sdlNetAllocSocketSetLookupFunction = libSdl2Net.lookupFunction<
      Pointer<SdlNetSocketSet> Function(Int32 maxsockets),
      Pointer<SdlNetSocketSet> Function(
          int maxsockets)>('SDLNet_AllocSocketSet');
  return sdlNetAllocSocketSetLookupFunction(maxsockets);
}