MCPcopy Index your code
hub / github.com/python/cpython / connect

Method connect

Lib/test/support/asyncore.py:334–346  ·  view source on GitHub ↗
(self, address)

Source from the content-addressed store, hash-verified

332 return self.socket.bind(addr)
333
334 def connect(self, address):
335 self.connected = False
336 self.connecting = True
337 err = self.socket.connect_ex(address)
338 if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
339 or err == EINVAL and os.name == 'nt':
340 self.addr = address
341 return
342 if err in (0, EISCONN):
343 self.addr = address
344 self.handle_connect_event()
345 else:
346 raise OSError(err, errorcode[err])
347
348 def accept(self):
349 # XXX can return either an address pair or None

Callers

nothing calls this directly

Calls 2

handle_connect_eventMethod · 0.95
connect_exMethod · 0.80

Tested by

no test coverage detected