anycall/connectionpool.py
def pre_connect(self, peer):
        """
        Ensures that we have an open connection to the given peer.
        
        Returns the peer id. This should be equal to the given one, but
        it might not if the given peer was, say, the IP and the peer
        actually identifies itself with a host name. The returned peer
        is the real one that should be used. This can be handy if we aren't
        100% sure of the peer's identity.
        """
        if peer in self._connections:
            return defer.succeed(peer)
        else:
            d = self._connect(peer, exact_peer=False)
            def connected(p):
                return p.peer
            d.addCallback(connected)
            return d
def pre_connect(self, peer):
        if peer in self._connections:
            return defer.succeed(peer)
        else:
            d = self._connect(peer, exact_peer=False)
            def connected(p):
                return p.peer
            d.addCallback(connected)
            return d
def pre_connect ( self , peer ) : if peer in self . _connections : return defer . succeed ( peer ) else : d = self . _connect ( peer , exact_peer = False ) def connected ( p ) : return p . peer d . addCallback ( connected ) return d
Ensures that we have an open connection to the given peer.
        
        Returns the peer id. This should be equal to the given one, but
        it might not if the given peer was, say, the IP and the peer
        actually identifies itself with a host name. The returned peer
        is the real one that should be used. This can be handy if we aren't
        100% sure of the peer's identity.
Ensures that we have an open connection to the given peer . Returns the peer id . This should be equal to the given one but it might not if the given peer was say the IP and the peer actually identifies itself with a host name . The returned peer is the real one that should be used . This can be handy if we aren t 100% sure of the peer s identity .