Cross platform library for the sendfile system call. This library tries to call minimum system calls which are the bottleneck of web servers.
- sendfile :: Socket -> FilePath -> FileRange -> IO ()
- data FileRange
- = EntireFile
- | PartOfFile { }
Documentation
sendfile :: Socket -> FilePath -> FileRange -> IO ()Source
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.
File range for sendfile
.