-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Socket to Socket Data Splicing (supports all operating systems) -- -- A library that implements most efficient socket to socket data -- transfer loops for proxy servers on each operating system. -- -- On Linux, it uses and exposes the zero-copy splice() system -- call: http://kerneltrap.org/node/6505. -- -- On other operating systems, it currently falls back to a portable -- Haskell implementation. -- -- @package splice @version 0.3 -- | This library implements most efficient socket to socket data transfer -- loops for proxy servers on each operating system. -- -- On Linux, it uses and exposes the zero-copy splice() system -- call: http://kerneltrap.org/node/6505. -- -- On other operating systems, it currently falls back to a portable -- Haskell implementation – which first allocates a constant-sized memory -- buffer in user address, then enters an inner loop which uses -- hGetBufSome and hPutBuf on this user-space buffer. This -- avoids tony of tiny allocations as might otherwise be caused by -- recv and sendAll from the bytestring package. module Network.Socket.Splice -- | Pipes data from one socket to another in an infinite loop. -- -- On Linux this uses the splice() system call and eliminates -- copying between kernel and user address spaces. -- -- On other operating systems, a portable Haskell implementation utilizes -- a user space buffer. splice :: ChunkSize -> Socket -> Socket -> IO () -- | The numeric type to recommend chunk sizes for moving data between -- sockets used by both zero-copy and portable implementations of -- splice. type ChunkSize = Int -- | Indicates whether splice uses zero-copy system calls or the -- portable user space Haskell implementation. zeroCopy :: Bool -- | Similar to try but used when an obvious exception is expected -- which can be safely ignored. try_ :: IO () -> IO ()