getpeername
The getpeername function retrieves the name of the peer to which a socket is connected.
int getpeername(
SOCKET s,
struct sockaddr FAR *name,
int FAR *namelen
);
Parameters
s
[in] Descriptor identifying a connected socket.
name
[out] The SOCKADDR structure that receives the name of the peer.
namelen
[in, out] Pointer to the size of the name structure.