Network.Sendfile

simple-sendfile-0.2.32: Cross platform library for the sendfile system call

Safe Haskell | None
Language | Haskell2010

Network.Sendfile

Description

Cross platform library for the sendfile system call. This library tries to call minimum system calls which are the bottleneck of web servers.

Synopsis

- sendfile :: Socket -> FilePath -> FileRange -> IO () -> IO ()
- sendfileWithHeader :: Socket -> FilePath -> FileRange -> IO () -> [ByteString] -> IO ()
- data FileRange
  - = EntireFile
  - | PartOfFile {
    - rangeOffset :: Integer
    - rangeLength :: Integer
    }

# Documentation

sendfile :: Socket -> FilePath -> FileRange -> IO () -> IO () #

Sendfile emulation using conduit. Used system calls:

- Used system calls: open(), stat(), read(), send() and close().

sendfileWithHeader :: Socket -> FilePath -> FileRange -> IO () -> [ByteString] -> IO () #

Sendfile emulation using conduit. Used system calls:

- Used system calls: open(), stat(), read(), writev(), send() and close().

data FileRange #

File range for `sendfile`.

Constructors

EntireFile |
PartOfFile |
Fields rangeOffset :: Integer rangeLength :: Integer