def _setup_connection(self, peer):
    (af, socktype, proto, canonname, sa) = socket.getaddrinfo(peer[0], peer[1], 0, socket.SOCK_DGRAM)[0]
    sock = socket.socket(af, socktype, proto)
    sock.connect(sa)
    sock = socket.socket(af, socktype, proto)
    sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    sock.bind((INADDR_ANY, 138))
    self.peer = peer
    return sock
def _setup_connection(self, peer):
    (af, socktype, proto, canonname, sa) = socket.getaddrinfo(peer[0], peer[1], 0, socket.SOCK_DGRAM)[0]
    sock = socket.socket(af, socktype, proto)
    sock.connect(sa)
    sock = socket.socket(af, socktype, proto)
    sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    sock.bind((INADDR_ANY, 138))
    self.peer = peer
    return sock