[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int SDLNet_ResolveHost(IPaddress *address,
const char *host,
Uint16 port)
Resolve the string host, and fill in the IPaddress pointed to by address
with the resolved IP and the port number passed in through port.
This is the best way to fill in the IPaddress struct for later use.
This function does not actually open any sockets, it is used to prepare the arguments for the socket opening functions.
WARNING: this function will put the host and port into Network Byte Order into the address fields, so make sure you pass in the data in your hosts byte order. (normally not an issue)
Returns: 0 on success. -1 on errors, plus address.host will be INADDR_NONE. An error would likely be that the address could not be resolved.
For a server listening on all interfaces, on port 1234:
|
For a client connecting to "host.domain.ext", at port 1234:
|
See Also:
3.2.2 SDLNet_ResolveIP,
4.1 IPaddress
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |