Retrieves the name of a peer connected to a socket.
- Parameters
-
| s | Descriptor identifying a connected socket. |
| name | Structure that receives the name (address) of the peer. |
| namelen | Pointer to the size of the name structure. |
- Returns
- This function returns:
- See also
- fnet_socket_getname()
This function retrieves the name of the peer connected to the socket s and stores it in the fnet_sockaddr structure identified by name.
The fnet_socket_getpeername() function can be used only with a connected socket. For datagram sockets, only the name of a peer specified in a previous fnet_socket_connect() call will be returned - any name specified by a previous fnet_socket_sendto() call will not be returned by the fnet_socket_getpeername().