Get the remote host address and port number
an IPaddress. NULL is returned on errors, or when sock is a server socket.
Binds to C-function call in SDL_net.h:
extern DECLSPEC IPaddress * SDLCALL SDLNet_TCP_GetPeerAddress(TCPsocket sock)
// get the remote IP and port //TCPsocket new_tcpsock; IPaddress *remote_ip; remote_ip=SDLNet_TCP_GetPeerAddress(new_tcpsock); if(!remote_ip) { printf("SDLNet_TCP_GetPeerAddress: %s\n", SDLNet_GetError()); printf("This may be a server socket.\n"); } else { // print the info in IPaddress or something else... }
SdlNet Class | Tao.Sdl Namespace | SDLNet_TCP_Open | SDLNet_TCP_Accept | SdlNet.IPaddress | SdlNet.TCPsocket