/
getpeername TCP UDP
getpeername TCP UDP
Returns the address of the peer connected on a socket.
Files
net_bsd.h/net_bsd.c
Prototype
int getpeername ( int sock_id, struct sockaddr *addr, socklen_t *addrlen);
Arguments
sock_id
Socket whose peer name will get returned.
addr
Pointer to a struct sockaddr instance that will be populated with the peer's info.
len
Pointer to a socklen_t variable that will get the length of the peer's address.
Returned Value
0, if no error.
-1, otherwise.
Related content
socket TCP UDP
socket TCP UDP
More like this
bind TCP UDP
bind TCP UDP
More like this
connect TCP UDP
connect TCP UDP
More like this
gethostname TCP UDP
gethostname TCP UDP
More like this
getnameinfo TCP UDP
getnameinfo TCP UDP
More like this
accept TCP
accept TCP
More like this