(index ("sendfile" 0) ("impl:mmapped" 850) ("impl:sendfile" 1374) ("impl:read-write-loop/port" 1855) ("impl:read-write-loop/fd" 2316) ("force-implementation" 2410) ("implementation-selector" 2859))
(def (sig (procedure "(sendfile source destination  #!key (offset 0) (bytes #f))" (id sendfile))) (p "Tries to send the file identified by `source` to `destination` as fast as possible. Unless a specific technique is forced it will decide what method to use from the systems capabilities and the filesize. " (tt "source") "  can be either a port to the inputfile or a filedescriptor of an already opened file. " (tt "destination") " can be either a port to the outputfile (socket) or a filedescriptor (socketdesciptor) of an already opened file (socket). When it is a port, any buffered output is flushed via " (tt "flush-output") " prior to sending the file. " (tt "offset") " If given the procedure seeks to " (tt "offset") " bytes and starts to transfer from there on " (tt "bytes") " If given it transfers only " (tt "bytes") " bytes of data."))
(def (sig (procedure "(impl:mmapped src dst len #!key (offset 0.0))" (id impl:mmapped))) (p "Sends a file by mapping it into the memory and do repeated writes. " (tt "source") " is the filedescriptor of an already opened file. " (tt "destination") " is the filedescriptor of an already opened file (can be a socket). " (tt "len") " is the size of the file in bytes as e.g. retrieved by (file-size). " (tt "offset") " is the offset where to start the read. This procedure returns the amount of bytes successfully written."))
(def (sig (procedure "(impl:sendfile src dst len)" (id impl:sendfile))) (p "If it is available this is the interface to the sendfile-implementation of your operating system " (tt "source") " is the filedescriptor of an already opened file. " (tt "destination") " is the filedescriptor of an already opened file (MUST be a socket). " (tt "len") " is the size of the file in bytes as e.g. retrieved by (file-size). This procedure returns the amount of bytes successfully written."))
(def (sig (procedure " (impl:read-write-loop/port src dst len)" (id impl:read-write-loop/port))) (p "Sends a file by performing repeated reads and writes where the source is a port. " (tt "source") "  is  the input-port. " (tt "destination") " is the filedescriptor of an already opened file (can be a socket). " (tt "len") " is the size of the file in bytes as e.g. retrieved by (file-size). This procedure returns the amount of bytes successfully written."))
(def (sig (procedure " (impl:read-write-loop/fd src dst len)" (id impl:read-write-loop/fd))))
(def (sig (parameter "force-implementation" (id force-implementation))) (p "Causes sendfile to always use the transmission-method specified by this parameter. Possible values are " (tt "'sendfile") "," (tt "'mmapped") "," (tt "'read-write") " and " (tt "'nothing") ". It defaults to " (tt "'nothing") ", where " (tt "sendfile") " will decide which method to use based on the system's capabilities and " (tt "sendfile:implementation-selector") "."))
(def (sig (parameter "implementation-selector" (id implementation-selector))) (p "A one-argument procedure that gets the size of the file in question passed and is expected to return a procedure to use."))
