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

Method _sock_recv

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

Source from the content-addressed store, hash-verified

395 self.remove_reader(fd)
396
397 def _sock_recv(self, fut, sock, n):
398 # _sock_recv() can add itself as an I/O callback if the operation can't
399 # be done immediately. Don't use it directly, call sock_recv().
400 if fut.done():
401 return
402 try:
403 data = sock.recv(n)
404 except (BlockingIOError, InterruptedError):
405 return # try again next time
406 except (SystemExit, KeyboardInterrupt):
407 raise
408 except BaseException as exc:
409 fut.set_exception(exc)
410 else:
411 fut.set_result(data)
412
413 async def sock_recv_into(self, sock, buf):
414 """Receive data from the socket.

Callers

nothing calls this directly

Calls 4

doneMethod · 0.45
recvMethod · 0.45
set_exceptionMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected