Embedded TCP/IP stack
4.7.0
|
fnet_return_t fnet_socket_getpeername | ( | fnet_socket_t | s, |
struct fnet_sockaddr * | name, | ||
fnet_size_t * | namelen | ||
) |
Retrieves the name of a peer connected to a socket.
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. |
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().