[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6.1 SDLNet_AllocSocketSet

SDLNet_SocketSet SDLNet_AllocSocketSet(int maxsockets)

maxsockets
The maximum number of sockets you will want to watch.

Create a socket set that will be able to watch up to maxsockets number of sockets. The same socket set can be used for both UDP and TCP sockets.

Returns: A new, empty, SDLNet_SocketSet. NULL is returned on errors, such as out-of-memory.

 
// Create a socket set to handle up to 16 sockets
SDLNet_SocketSet set;

set=SDLNet_AllocSocketSet(16);
if(!set) {
    printf("SDLNet_AllocSocketSet: %s\n", SDLNet_GetError());
    exit(1); //most of the time this is a major error, but do what you want.
}

See Also:
3.6.2 SDLNet_FreeSocketSet, 3.6.3 SDLNet_AddSocket, 4.5 SDLNet_SocketSet, 4.3 UDPsocket, 4.2 TCPsocket



This document was generated on November, 3 2009 using texi2html