Obtaining Socket Addresses
New sockets sometimes inherit the set of open sockets that created them. The sockets program interface includes subroutines that allow an application to obtain the address of the destination to which a socket connects and the local address of a socket.
The following socket subroutines allow a program to retrieve socket addresses:
For additional information that you might need before binding or obtaining socket addresses, read the following concepts: