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

Method _sock_accept

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

Source from the content-addressed store, hash-verified

714 return await fut
715
716 def _sock_accept(self, fut, sock):
717 fd = sock.fileno()
718 try:
719 conn, address = sock.accept()
720 conn.setblocking(False)
721 except (BlockingIOError, InterruptedError):
722 self._ensure_fd_no_transport(fd)
723 handle = self._add_reader(fd, self._sock_accept, fut, sock)
724 fut.add_done_callback(
725 functools.partial(self._sock_read_done, fd, handle=handle))
726 except (SystemExit, KeyboardInterrupt):
727 raise
728 except BaseException as exc:
729 fut.set_exception(exc)
730 else:
731 fut.set_result((conn, address))
732
733 async def _sendfile_native(self, transp, file, offset, count):
734 del self._transports[transp._sock_fd]

Callers 1

sock_acceptMethod · 0.95

Calls 9

_add_readerMethod · 0.95
partialMethod · 0.80
filenoMethod · 0.45
acceptMethod · 0.45
setblockingMethod · 0.45
add_done_callbackMethod · 0.45
set_exceptionMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected