Tao.Sdl SDK Documentation

SdlNet.SDLNet_DelSocket Method 

Remove a socket from a socket set

[Visual Basic]
Public Shared Sub SDLNet_DelSocket( _
   ByVal set As SDLNet_SocketSet, _
   ByVal sock As SDLNet_GenericSocket _
)
[C#]
public static void SDLNet_DelSocket(
   SDLNet_SocketSet set,
   SDLNet_GenericSocket sock
);

Parameters

set
The socket set to remove this socket from
sock
the socket to remove from the socket set

Return Value

the number of sockets used in the set on success. -1 is returned on errors.

Remarks

Free the socket set from memory. Do not reference the set after this call, except to allocate a new one.

Binds to C-function call in SDL_net.h:

            extern DECLSPEC int SDLCALL SDLNet_DelSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock)
            

Example

            // remove two sockets from a socket set
            //SDLNet_SocketSet set;
            //UDPsocket udpsock;
            //TCPsocket tcpsock;
            int numused;
            numused=SDLNet_UDP_DelSocket(set,udpsock);
            if(numused==-1) {
            printf("SDLNet_DelSocket: %s\n", SDLNet_GetError());
            // perhaps the socket is not in the set
            }
            numused=SDLNet_TCP_DelSocket(set,tcpsock);
            if(numused==-1) {
            printf("SDLNet_DelSocket: %s\n", SDLNet_GetError());
            // perhaps the socket is not in the set
            }
            

See Also

SdlNet Class | Tao.Sdl Namespace | SDLNet_AddSocket | SDLNet_FreeSocketSet | SdlNet.SDLNet_SocketSet | SdlNet.UDPsocket | SdlNet.TCPsocket