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

Method sock_recv_into

Lib/asyncio/selector_events.py:410–429  ·  view source on GitHub ↗

Receive data from the socket. The received data is written into *buf* (a writable buffer). The return value is the number of bytes written.

(self, sock, buf)

Source from the content-addressed store, hash-verified

408 fut.set_result(data)
409
410 async def sock_recv_into(self, sock, buf):
411 """Receive data from the socket.
412
413 The received data is written into *buf* (a writable buffer).
414 The return value is the number of bytes written.
415 """
416 base_events._check_ssl_socket(sock)
417 if self._debug and sock.gettimeout() != 0:
418 raise ValueError("the socket must be non-blocking")
419 try:
420 return sock.recv_into(buf)
421 except (BlockingIOError, InterruptedError):
422 pass
423 fut = self.create_future()
424 fd = sock.fileno()
425 self._ensure_fd_no_transport(fd)
426 handle = self._add_reader(fd, self._sock_recv_into, fut, sock, buf)
427 fut.add_done_callback(
428 functools.partial(self._sock_read_done, fd, handle=handle))
429 return await fut
430
431 def _sock_recv_into(self, fut, sock, buf):
432 # _sock_recv_into() can add itself as an I/O callback if the operation

Callers

nothing calls this directly

Calls 8

_add_readerMethod · 0.95
partialMethod · 0.80
gettimeoutMethod · 0.45
recv_intoMethod · 0.45
create_futureMethod · 0.45
filenoMethod · 0.45
add_done_callbackMethod · 0.45

Tested by

no test coverage detected