- Method query_address
Get address and port of a socket end-point.
If the argument
localis not specified, or is
0(zero), the remote end-point is returned. Otherwise, if
1, the local end-point is returned.
This function returns the address and port of a socket end-point on the form
"x.x.x.x port"(IPv4) or
"x:x:x:x:x:x:x:x port"(IPv6). IPv6 addresses may use the contracted syntax.
If this file is not a socket, is not connected, or some other error occurs,
0(zero) is returned and errno() will return the error code.
An error is thrown if the socket (or file) isn't open.
- See also