(self, transport, file, offset=0, count=None,
                       *, fallback=True)
return await self._sendfile_fallback(transport, file,
                                             offset, count)
Send a file to transport.

        Return the total number of bytes which were sent.

        The method uses high-performance os.sendfile if available.

        file must be a regular file object opened in binary mode.

        offset tells from where to start reading the file. If specified,
        count is the total number of bytes to transmit as opposed to
        sending the file until EOF is reached. File position is updated on
        return or also in case of error in which case file.tell()
        can be used to figure out the number of bytes
        which were sent.

        fallback set to True makes asyncio to manually read and send
        the file when the platform does not support the sendfile syscall
        (e.g. Windows or SSL socket on Unix).

        Raise SendfileNotAvailableError if the system does not support
        sendfile syscall and fallback is False.
Send a file to transport.
Send a file to transport .
async def sendfile(self, transport, file, offset=0, count=None,
                       *, fallback=True):
        """Send a file to transport.

        Return the total number of bytes which were sent.

        The method uses high-performance os.sendfile if available.

        file must be a regular file object opened in binary mode.

        offset tells from where to start reading the file. If specified,
        count is the total number of bytes to transmit as opposed to
        sending the file until EOF is reached. File position is updated on
        return or also in case of error in which case file.tell()
        can be used to figure out the number of bytes
        which were sent.

        fallback set to True makes asyncio to manually read and send
        the file when the platform does not support the sendfile syscall
        (e.g. Windows or SSL socket on Unix).

        Raise SendfileNotAvailableError if the system does not support
        sendfile syscall and fallback is False.
        """
        if transport.is_closing():
            raise RuntimeError("Transport is closing")
        mode = getattr(transport, '_sendfile_compatible',
                       constants._SendfileMode.UNSUPPORTED)
        if mode is constants._SendfileMode.UNSUPPORTED:
            raise RuntimeError(
                f"sendfile is not supported for transport {transport!r}")
        if mode is constants._SendfileMode.TRY_NATIVE:
            try:
                return await self._sendfile_native(transport, file,
                                                   offset, count)
            except exceptions.SendfileNotAvailableError as exc:
                if not fallback:
                    raise

        if not fallback:
            raise RuntimeError(
                f"fallback is disabled and native sendfile is not "
                f"supported for transport {transport!r}")

        return await self._sendfile_fallback(transport, file,
                                             offset, count)
async def sendfile ( self , transport , file , offset = 0 , count = None , * , fallback = True ) : if transport . is_closing ( ) : raise RuntimeError ( "Transport is closing" ) mode = getattr ( transport , '_sendfile_compatible' , constants . _SendfileMode . UNSUPPORTED ) if mode is constants . _SendfileMode . UNSUPPORTED : raise RuntimeError ( f"sendfile is not supported for transport {transport!r}" ) if mode is constants . _SendfileMode . TRY_NATIVE : try : return await self . _sendfile_native ( transport , file , offset , count ) except exceptions . SendfileNotAvailableError as exc : if not fallback : raise if not fallback : raise RuntimeError ( f"fallback is disabled and native sendfile is not " f"supported for transport {transport!r}" ) return await self . _sendfile_fallback ( transport , file , offset , count )