IPSocket.getsockname

Obtains the current address to which this socket is bound.

  1. int getsockname(InAddr local_address)
    class IPSocket(bool IPv6 = false)
    int
    getsockname
  2. int getsockname(sockaddr* local_address, socklen_t addrlen)

Parameters

local_address InAddr

filled in with the address of the local socket, as known to the communications layer, depending on the IP version of this class

Return Value

Type: int

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

Errors: EBADF The argument sockfd is not a valid descriptor.

EFAULT The local_address argument points to memory not in a valid part of the process address space.

ENOBUFS Insufficient resources were available in the system to perform the operation.

ENOTSOCK this.fd is a file, not a socket.

Meta