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

Method sock_sendfile

Lib/asyncio/base_events.py:943–956  ·  view source on GitHub ↗
(self, sock, file, offset=0, count=None,
                            *, fallback=True)

Source from the content-addressed store, hash-verified

941 None, socket.getnameinfo, sockaddr, flags)
942
943 async def sock_sendfile(self, sock, file, offset=0, count=None,
944 *, fallback=True):
945 if self._debug and sock.gettimeout() != 0:
946 raise ValueError("the socket must be non-blocking")
947 _check_ssl_socket(sock)
948 self._check_sendfile_params(sock, file, offset, count)
949 try:
950 return await self._sock_sendfile_native(sock, file,
951 offset, count)
952 except exceptions.SendfileNotAvailableError as exc:
953 if not fallback:
954 raise
955 return await self._sock_sendfile_fallback(sock, file,
956 offset, count)
957
958 async def _sock_sendfile_native(self, sock, file, offset, count):
959 # NB: sendfile syscall is not supported for SSL sockets and

Callers

nothing calls this directly

Calls 5

_sock_sendfile_nativeMethod · 0.95
_check_ssl_socketFunction · 0.85
gettimeoutMethod · 0.45

Tested by

no test coverage detected