Go to the previous, next section.

getpeername

SYNOPSIS

int getpeername(int s, struct sockaddr *name, int *namelen);

PARAMETERS

s: [in] the socket.

name: [out] points to the buffer where to store the name.

namelen: [in out] the maximum length (in bytes) of name.

DESCRIPTION

Returns the name of the peer machine connected to the remote end of a socket. If the buffer is too small, the name is truncated.

RETURN VALUE

On success zero is returned. On error, -1 is returned and errno is set to one of the following values:

Go to the previous, next section.