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

Method sock_accept

Lib/asyncio/selector_events.py:701–714  ·  view source on GitHub ↗

Accept a connection. The socket must be bound to an address and listening for connections. The return value is a pair (conn, address) where conn is a new socket object usable to send and receive data on the connection, and address is the address bound to the socket o

(self, sock)

Source from the content-addressed store, hash-verified

699 fut = None
700
701 async def sock_accept(self, sock):
702 """Accept a connection.
703
704 The socket must be bound to an address and listening for connections.
705 The return value is a pair (conn, address) where conn is a new socket
706 object usable to send and receive data on the connection, and address
707 is the address bound to the socket on the other end of the connection.
708 """
709 base_events._check_ssl_socket(sock)
710 if self._debug and sock.gettimeout() != 0:
711 raise ValueError("the socket must be non-blocking")
712 fut = self.create_future()
713 self._sock_accept(fut, sock)
714 return await fut
715
716 def _sock_accept(self, fut, sock):
717 fd = sock.fileno()

Callers

nothing calls this directly

Calls 3

_sock_acceptMethod · 0.95
gettimeoutMethod · 0.45
create_futureMethod · 0.45

Tested by

no test coverage detected