Open a TCP network socket.
Defined in SDL_net.h
ip | The address to open a connection to (or to host a server on). |
Returns the newly created socket, or NULL if there was an error.
If ip->host
is INADDR_NONE or INADDR_ANY, this creates a local server socket on the given port, otherwise a TCP connection to the remote host and port is attempted. The address passed in should already be swapped to network byte order (addresses returned from SDLNet_ResolveHost() are already in the correct form).
This function is available since SDL_net 2.0.0.