socket.getnameinfo()

socket.getnameinfo(sockaddr, flags) --> (host, port)

Get host and port for a sockaddr.