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

Method _sock_connect_cb

Lib/asyncio/selector_events.py:680–699  ·  view source on GitHub ↗
(self, fut, sock, address)

Source from the content-addressed store, hash-verified

678 self.remove_writer(fd)
679
680 def _sock_connect_cb(self, fut, sock, address):
681 if fut.done():
682 return
683
684 try:
685 err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
686 if err != 0:
687 # Jump to any except clause below.
688 raise OSError(err, f'Connect call failed {address}')
689 except (BlockingIOError, InterruptedError):
690 # socket is still registered, the callback will be retried later
691 pass
692 except (SystemExit, KeyboardInterrupt):
693 raise
694 except BaseException as exc:
695 fut.set_exception(exc)
696 else:
697 fut.set_result(None)
698 finally:
699 fut = None
700
701 async def sock_accept(self, sock):
702 """Accept a connection.

Callers

nothing calls this directly

Calls 4

doneMethod · 0.45
getsockoptMethod · 0.45
set_exceptionMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected