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

Method sock_sendfile

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

Source from the content-addressed store, hash-verified

946 None, socket.getnameinfo, sockaddr, flags)
947
948 async def sock_sendfile(self, sock, file, offset=0, count=None,
949 *, fallback=True):
950 if self._debug and sock.gettimeout() != 0:
951 raise ValueError("the socket must be non-blocking")
952 _check_ssl_socket(sock)
953 self._check_sendfile_params(sock, file, offset, count)
954 try:
955 return await self._sock_sendfile_native(sock, file,
956 offset, count)
957 except exceptions.SendfileNotAvailableError:
958 if not fallback:
959 raise
960 return await self._sock_sendfile_fallback(sock, file,
961 offset, count)
962
963 async def _sock_sendfile_native(self, sock, file, offset, count):
964 # 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