pysyncobj/transport.py
def _connectIfNecessarySingle(self, node):
        """
        Connect to a node if necessary.

        :param node: node to connect to
        :type node: Node
        """

        if node in self._connections and self._connections[node].state != CONNECTION_STATE.DISCONNECTED:
            return True
        if not self._shouldConnect(node):
            return False
        assert node in self._connections # Since we "should connect" to this node, there should always be a connection object already in place.
        if node in self._lastConnectAttempt and time.time() - self._lastConnectAttempt[node] < self._syncObj.conf.connectionRetryTime:
            return False
        self._lastConnectAttempt[node] = time.time()
        return self._connections[node].connect(node.ip, node.port)
def _connectIfNecessarySingle(self, node):
        if node in self._connections and self._connections[node].state != CONNECTION_STATE.DISCONNECTED:
            return True
        if not self._shouldConnect(node):
            return False
        assert node in self._connections # Since we "should connect" to this node, there should always be a connection object already in place.
        if node in self._lastConnectAttempt and time.time() - self._lastConnectAttempt[node] < self._syncObj.conf.connectionRetryTime:
            return False
        self._lastConnectAttempt[node] = time.time()
        return self._connections[node].connect(node.ip, node.port)
def _connectIfNecessarySingle ( self , node ) : if node in self . _connections and self . _connections [ node ] . state != CONNECTION_STATE . DISCONNECTED : return True if not self . _shouldConnect ( node ) : return False assert node in self . _connections # Since we "should connect" to this node, there should always be a connection object already in place. if node in self . _lastConnectAttempt and time . time ( ) - self . _lastConnectAttempt [ node ] < self . _syncObj . conf . connectionRetryTime : return False self . _lastConnectAttempt [ node ] = time . time ( ) return self . _connections [ node ] . connect ( node . ip , node . port )
Connect to a node if necessary.

        :param node: node to connect to
        :type node: Node
Connect to a node if necessary .