next up previous contents index
Next: 8.2.9 getsockoptsetsockopt: get Up: 8.2 oskit_socket: Socket Interface Previous: 8.2.7 getsockname: get socket

8.2.8 getpeername: get name of connected peer

 

SYNOPSIS

#include <oskit/net/socket.h>

oskit_error_t oskit_socket_getpeername(oskit_socket_t *s, [out] struct oskit_sockaddr *asa, [in/out] oskit_size_t *anamelen);

DESCRIPTION

getpeername returns the name of the peer connected to socket s.

PARAMETERS

s
The socket connected to the peer whose name is to be returned.

name
Contains the peer's name upon return.

anamelen
Initially, the amount of space pointed to by name, on return it will contain the amount actually used. The name is truncated if the buffer provided is too small.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



University of Utah Flux Research Group