nn::socket::Bind Function

Syntax

s32 Bind(
     s32 s,
     const SockAddrIn * sockAddr
);

Arguments

Name Description
in s Specifies the socket descriptor. Specify a socket descriptor created using the Socket function.
in sockAddr Specify a pointer to a socket address structure (SockAddrIn) with information about the address to assign.

Return Values



Value Description
0 Process was successful.
ENETRESET Socket library is not initialized.
EBADF Invalid socket descriptor.
EOPNOTSUPP Process not supported.
EINVAL Invalid processing. (Socket is already bound to address, etc.)
EAFNOSUPPORT Address family not supported.
EADDRINUSE Address is already in use.

Description

Allocates a local socket address to a socket.

The local socket address is the address on the communication source side. A socket created using the Socket function is not initially bound to any address. This function fails if the specified socket descriptor is already bound. You can get the allocated local socket address with GetSockName.

See Also

Socket, GetSockName

Revision History

2010/06/14
Initial version.

CONFIDENTIAL