nn::socket::GetSockName Function

Syntax

s32 GetSockName(
     s32 s,
     SockAddrIn * sockAddr
);

Arguments

Name Description
in s Specifies a socket descriptor. Specify a socket descriptor created using the Socket or Accept function.
in sockAddr Specifies a pointer to the socket address structure used to get the address that is bound to the socket.

Return Values



Value Description
0 Process was successful.
ENETRESET Socket library is not initialized.
EBADF Invalid socket descriptor.
EINVAL Invalid processing.

Description

Gets the socket's local address.

The local address is used as the communication source address. The local address is determined by calling the Bind or Connect functions. If the local address is undetermined, this function returns an error for TCP sockets. For UDP sockets, this function returns the default value of 0.0.0.0.

See Also

GetPeerName

Revision History

2010/06/14
Initial version.

CONFIDENTIAL