getsockname() -> address info Return the address of the local endpoint. The format depends on the address family. For IPv4 sockets, the address info is a pair (hostaddr, port). For IPv6 sockets, the address info is a 4-tuple (hostaddr, port, flowinfo, scope_id).