SDL Wiki
(This function is part of SDL_net, a separate library from SDL.)

SDLNet_AllocSocketSet

Allocate a socket set for use with SDLNet_CheckSockets().

Header File

Defined in <SDL_net.h>

Syntax

SDLNet_SocketSet SDLNet_AllocSocketSet(int maxsockets);

Function Parameters

int maxsockets the maximum amount of sockets to include in this set.

Return Value

(SDLNet_SocketSet) Returns a socket set for up to maxsockets sockets, or NULL if the function ran out of memory.

Remarks

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.

Version

This function is available since SDL_net 2.0.0.

See Also


CategoryAPI, CategoryAPIFunction


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.