AddressIPSocket.bind

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

  1. int bind(cstring local_ip_address, ushort local_port)
    class AddressIPSocket(bool IPv6 = false)
    override
    int
    bind
  2. int bind(ushort local_port)

Parameters

local_ip_address cstring

local IP address

local_port ushort

local port or 0 to use the wildcard "any" port

Return Value

Type: int

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

Errors: as the overridden method but also sets errno to EINVAL if the address does not contain a valid IP address string.

Meta