def loopback_address(socket):
    if (socket.family == AF_INET):
        return '127.0.0.1'
    else:
        assert (socket.family == AF_INET6)
        return '::1'
def loopback_address(socket):
    if (socket.family == AF_INET):
        return '127.0.0.1'
    else:
        assert (socket.family == AF_INET6)
        return '::1'