Example #1
0
 def handle_connect(self):
     try:
         AdvancedDispatcher.handle_connect(self)
     except socket.error as e:
         if e.errno in asyncore._DISCONNECTED:
             logger.debug("%s:%i: Connection failed: %s" % (self.destination.host, self.destination.port, str(e)))
             return
     self.nodeid = randomBytes(8)
     self.append_write_buf(protocol.assembleVersionMessage(self.destination.host, self.destination.port, \
             network.connectionpool.BMConnectionPool().streams, False, nodeid=self.nodeid))
     #print "%s:%i: Sending version"  % (self.destination.host, self.destination.port)
     self.connectedAt = time.time()
     receiveDataQueue.put(self.destination)
Example #2
0
 def handle_connect(self):
     try:
         AdvancedDispatcher.handle_connect(self)
     except socket.error as e:
         if e.errno in asyncore._DISCONNECTED:
             logger.debug("%s:%i: Connection failed: %s" % (self.destination.host, self.destination.port, str(e)))
             return
     self.nodeid = randomBytes(8)
     self.append_write_buf(protocol.assembleVersionMessage(self.destination.host, self.destination.port, \
             network.connectionpool.BMConnectionPool().streams, False, nodeid=self.nodeid))
     #print "%s:%i: Sending version"  % (self.destination.host, self.destination.port)
     self.connectedAt = time.time()
     receiveDataQueue.put(self.destination)
Example #3
0
 def handle_connect(self):
     """Callback for TCP connection being established."""
     try:
         AdvancedDispatcher.handle_connect(self)
     except socket.error as e:
         # pylint: disable=protected-access
         if e.errno in asyncore._DISCONNECTED:
             logger.debug(
                 '%s:%i: Connection failed: %s',
                 self.destination.host, self.destination.port, e)
             return
     self.nodeid = randomBytes(8)
     self.append_write_buf(
         protocol.assembleVersionMessage(
             self.destination.host, self.destination.port,
             connectionpool.BMConnectionPool().streams,
             False, nodeid=self.nodeid))
     self.connectedAt = time.time()
     receiveDataQueue.put(self.destination)