MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / handle_connect

Method handle_connect

src/network/tcp.py:190–202  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 sendChunk()
189
190 def handle_connect(self):
191 try:
192 AdvancedDispatcher.handle_connect(self)
193 except socket.error as e:
194 if e.errno in asyncore._DISCONNECTED:
195 logger.debug("%s:%i: Connection failed: %s" % (self.destination.host, self.destination.port, str(e)))
196 return
197 self.nodeid = randomBytes(8)
198 self.append_write_buf(protocol.assembleVersionMessage(self.destination.host, self.destination.port, \
199 network.connectionpool.BMConnectionPool().streams, False, nodeid=self.nodeid))
200 #print "%s:%i: Sending version" % (self.destination.host, self.destination.port)
201 self.connectedAt = time.time()
202 receiveDataQueue.put(self.destination)
203
204 def handle_read(self):
205 TLSDispatcher.handle_read(self)

Callers

nothing calls this directly

Calls 3

randomBytesFunction · 0.90
append_write_bufMethod · 0.80
putMethod · 0.80

Tested by

no test coverage detected