MCPcopy Create free account
hub / github.com/python/cpython / _sock_recvfrom_into

Method _sock_recvfrom_into

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

Source from the content-addressed store, hash-verified

514 return await fut
515
516 def _sock_recvfrom_into(self, fut, sock, buf, bufsize):
517 # _sock_recv_into() can add itself as an I/O callback if the operation
518 # can't be done immediately. Don't use it directly, call
519 # sock_recv_into().
520 if fut.done():
521 return
522 try:
523 result = sock.recvfrom_into(buf, bufsize)
524 except (BlockingIOError, InterruptedError):
525 return # try again next time
526 except (SystemExit, KeyboardInterrupt):
527 raise
528 except BaseException as exc:
529 fut.set_exception(exc)
530 else:
531 fut.set_result(result)
532
533 async def sock_sendall(self, sock, data):
534 """Send data to the socket.

Callers

nothing calls this directly

Calls 4

doneMethod · 0.45
recvfrom_intoMethod · 0.45
set_exceptionMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected