IPSocket.bind

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

Parameters

local_address InAddr

local address

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