ISocket.bind

Assigns a local address to this socket. This socket needs to have been created by socket().

Note: This generic wrapper should be used only in special situations, the subclass variants for a particular address family are preferred.

class ISocket
int
bind
(
sockaddr* local_address
)

Parameters

local_address sockaddr*

local internet address, expected to point to a sin_addr or sin6_addr instance, depending on the IP version of this instance

Return Value

Type: int

0 on success or -1 on failure. On failure errno is set appropriately.

Errors: EACCES The address is protected, and the user is not the superuser.

EADDRINUSE The given address is already in use.

EBADF sockfd is not a valid descriptor.

EINVAL The socket is already bound to an address.

ENOTSOCK The file descriptor is a descriptor for a file, not a socket.

Meta