SOGetPeerName

Syntax

#include <cafe.h>
#include <cafe/network.h>

int SOGetPeerName(int fd, struct sockaddr *name, int *addrlen);

Parameters

fd Socket upon which the peer is connected.
name Destination address of the peer.
addrlen Initialized with the length of name; upon return will contain the actual size of the retrieved address.

Return Values

0 upon success. Upon failure, returns -1 and errno is set appropriately.

Errors

SO_ENOTCONN The socket is not connected.

Description

Retrieve the name (address) of the peer connected to the specified socket.

Do Not Call From

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

See Also

SOBind
SOGetSockName
SOSocket

Revision History

2012/08/16 Cleanup pass.
2011/07/11 Added Errors section.
2011/02/21 Initial version.


CONFIDENTIAL