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

Method _sock_recv_into

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

Source from the content-addressed store, hash-verified

432 return await fut
433
434 def _sock_recv_into(self, fut, sock, buf):
435 # _sock_recv_into() can add itself as an I/O callback if the operation
436 # can't be done immediately. Don't use it directly, call
437 # sock_recv_into().
438 if fut.done():
439 return
440 try:
441 nbytes = sock.recv_into(buf)
442 except (BlockingIOError, InterruptedError):
443 return # try again next time
444 except (SystemExit, KeyboardInterrupt):
445 raise
446 except BaseException as exc:
447 fut.set_exception(exc)
448 else:
449 fut.set_result(nbytes)
450
451 async def sock_recvfrom(self, sock, bufsize):
452 """Receive a datagram from a datagram socket.

Callers

nothing calls this directly

Calls 4

doneMethod · 0.45
recv_intoMethod · 0.45
set_exceptionMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected