If no port is specified, the port in the output is set to 0.
@param str The string to parse.
@param out A sockaddr to hold the result. This should probably be
a struct sockaddr_storage.
@param outlen A pointer to the number of bytes that that 'out' can safely
hold. Set to the number of bytes used in 'out' on success.
@return -1 if the address is not well-formed, if the port is out of range,
or if out is not large enough to hold the result. Otherwise returns
0 on success.
Parse an IPv4 or IPv6 address, with optional port, from a string.
Recognized formats are: - IPv6Address:port - IPv6Address - IPv6Address - IPv4Address:port - IPv4Address
If no port is specified, the port in the output is set to 0.
@param str The string to parse. @param out A sockaddr to hold the result. This should probably be a struct sockaddr_storage. @param outlen A pointer to the number of bytes that that 'out' can safely hold. Set to the number of bytes used in 'out' on success. @return -1 if the address is not well-formed, if the port is out of range, or if out is not large enough to hold the result. Otherwise returns 0 on success.