pysyncobj/transport.py
def addNode(self, node):
        """
        Add a node to the network

        :param node: node to add
        :type node: TCPNode
        """

        self._nodes.add(node)
        self._nodeAddrToNode[node.address] = node
        if self._shouldConnect(node):
            conn = TcpConnection(poller = self._syncObj._poller,
                                 timeout = self._syncObj.conf.connectionTimeout,
                                 sendBufferSize = self._syncObj.conf.sendBufferSize,
                                 recvBufferSize = self._syncObj.conf.recvBufferSize)
            conn.encryptor = self._syncObj.encryptor
            conn.setOnConnectedCallback(functools.partial(self._onOutgoingConnected, conn))
            conn.setOnMessageReceivedCallback(functools.partial(self._onMessageReceived, node))
            conn.setOnDisconnectedCallback(functools.partial(self._onDisconnected, conn))
            self._connections[node] = conn
def addNode(self, node):
        """
        Add a node to the network

        :param node: node to add
        :type node: TCPNode
        """

        self._nodes.add(node)
        self._nodeAddrToNode[node.address] = node
        if self._shouldConnect(node):
            conn = TcpConnection(poller = self._syncObj._poller,
                                 timeout = self._syncObj.conf.connectionTimeout,
                                 sendBufferSize = self._syncObj.conf.sendBufferSize,
                                 recvBufferSize = self._syncObj.conf.recvBufferSize)
            conn.encryptor = self._syncObj.encryptor
            conn.setOnConnectedCallback(functools.partial(self._onOutgoingConnected, conn))
            conn.setOnMessageReceivedCallback(functools.partial(self._onMessageReceived, node))
            conn.setOnDisconnectedCallback(functools.partial(self._onDisconnected, conn))
            self._connections[node] = conn
def addNode ( self , node ) : self . _nodes . add ( node ) self . _nodeAddrToNode [ node . address ] = node if self . _shouldConnect ( node ) : conn = TcpConnection ( poller = self . _syncObj . _poller , timeout = self . _syncObj . conf . connectionTimeout , sendBufferSize = self . _syncObj . conf . sendBufferSize , recvBufferSize = self . _syncObj . conf . recvBufferSize ) conn . encryptor = self . _syncObj . encryptor conn . setOnConnectedCallback ( functools . partial ( self . _onOutgoingConnected , conn ) ) conn . setOnMessageReceivedCallback ( functools . partial ( self . _onMessageReceived , node ) ) conn . setOnDisconnectedCallback ( functools . partial ( self . _onDisconnected , conn ) ) self . _connections [ node ] = conn
Add a node to the network

        :param node: node to add
        :type node: TCPNode
Add a node to the network