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

Method _sock_recvfrom

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

Source from the content-addressed store, hash-verified

472 return await fut
473
474 def _sock_recvfrom(self, fut, sock, bufsize):
475 # _sock_recvfrom() can add itself as an I/O callback if the operation
476 # can't be done immediately. Don't use it directly, call
477 # sock_recvfrom().
478 if fut.done():
479 return
480 try:
481 result = sock.recvfrom(bufsize)
482 except (BlockingIOError, InterruptedError):
483 return # try again next time
484 except (SystemExit, KeyboardInterrupt):
485 raise
486 except BaseException as exc:
487 fut.set_exception(exc)
488 else:
489 fut.set_result(result)
490
491 async def sock_recvfrom_into(self, sock, buf, nbytes=0):
492 """Receive data from the socket.

Callers

nothing calls this directly

Calls 4

doneMethod · 0.45
recvfromMethod · 0.45
set_exceptionMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected