The getsockname() function retrieves the locally-bound name of the specified socket, stores this address in the sockaddr structure pointed to by the address argument, and stores the length of this address in the object pointed to by the address_len argument.
If the actual length of the address is greater than the length of the supplied sockaddr structure, the stored address will be truncated.
If the socket has not been bound to a local name, the value stored in the object pointed to by address is unspecified.
|