-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Cross platform library for the sendfile system call
--
-- Cross platform library for the sendfile system call. This library
-- tries to call minimum system calls which are the bottleneck of web
-- servers.
@package simple-sendfile
@version 0.2.3
-- | Cross platform library for the sendfile system call. This library
-- tries to call minimum system calls which are the bottleneck of web
-- servers.
module Network.Sendfile
-- | Simple binding for sendfile() of Linux. Used system calls:
--
--
-- - EntireFile -- open(), stat(), sendfile(), and close() - PartOfFile
-- -- open(), sendfile(), and close()
--
--
-- If the size of the file is unknown when sending the entire file,
-- specifying PartOfFile is much faster.
--
-- The fourth action argument is called when a file is sent as chunks.
-- Chucking is inevitable if the socket is non-blocking (this is the
-- default) and the file is large. The action is called after a chunk is
-- sent and bofore waiting the socket to be ready for writing.
sendfile :: Socket -> FilePath -> FileRange -> IO () -> IO ()
-- | File range for sendfile.
data FileRange
EntireFile :: FileRange
PartOfFile :: Integer -> Integer -> FileRange
rangeOffset :: FileRange -> Integer
rangeLength :: FileRange -> Integer