Accept a connection on a server socket
a valid TCPsocket on success, which indicates a successful connection has been established. NULL is returned on errors, such as when it's not able to create a socket, or it cannot finish connecting to the originating host and port. There also may not be a connection attempt in progress, so of course you cannot accept nothing, and you get a NULL in this case as well.
Binds to C-function call in SDL_net.h:
extern DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Accept(TCPsocket server)
// accept a connection coming in on server_tcpsock TCPsocket new_tcpsock; new_tcpsock=SDLNet_TCP_Accept(server_tcpsock); if(!new_tcpsock) { printf("SDLNet_TCP_Accept: %s\n", SDLNet_GetError()); } else { // communicate over new_tcpsock }
SdlNet Class | Tao.Sdl Namespace | SDLNet_TCP_Open | SDLNet_TCP_Close | SDLNet_TCP_GetPeerAddress | SdlNet.TCPsocket