filled in with the address of the local socket, as known to the communications layer; expected to point to a sin_addr or sin6_addr instance, depending on the IP version of this instance
actual address struct length output, initialised to this.in_addrlen; returning a different value indicates socket family mixup
0 success or -1 on failure. On failure errno is set appropriately.
Errors: EBADF this.fd is not a valid descriptor.
EFAULT local_address points to memory not in a valid part of the process address space.
EINVAL addrlen is invalid (e.g., is negative).
ENOBUFS Insufficient resources were available in the system to perform the operation.
ENOTSOCK this.fd is a file, not a socket.
Obtains the local socket address.
Note: This generic wrapper should be used only in special situations, the subclass variants for a particular address family are preferred.
getsockname() returns the current address to which this socket is bound, in the buffer pointed to by local_address. The addrlen argument is initialized to this.in_addrlen which indicates the amount of space pointed to by addr. On return it contains the actual size of the name returned (in bytes). The name is truncated if the buffer provided is too small; in this case, addrlen will return a value greater than this.in_addrlen.