MCPcopy Index your code
hub / github.com/RustPython/RustPython / _sock_recvfrom

Method _sock_recvfrom

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

Source from the content-addressed store, hash-verified

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