-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Socket to Socket Data Splicing -- -- A library that implements efficient socket to socket data transfer -- loops for proxy servers. -- -- On Linux, it uses the zero-copy splice() system call: -- http://kerneltrap.org/node/6505. -- -- On all other operating systems, it currently falls back to a portable -- Haskell implementation that allocates a constant-sized memory buffer -- before it enters an inner loop which then uses hGetBufSome and -- hPutBuf; this avoids lots of tiny allocations as would otherwise be -- caused by recv and sendAll functions from Network.Socket.ByteString. -- -- This work has been funded by Corsis Research and is used in -- PortFusion: http://portfusion.sf.net @package splice @version 0.1 module Network.Socket.Splice type Length = Word32 -- | Indicates whether loopSplice uses zero copy system calls or the -- portable user mode Haskell substitue implementation. zeroCopy :: Bool -- | The loopSplice function pipes data from one socket to another -- in an infinite loop. On Linux this happens in kernel space with zero -- copying, between kernel and user space. On other operating systems, a -- portable implementation utilizes a user space buffer and works on -- handles instead of file descriptors. loopSplice :: Length -> Socket -> Socket -> IO () c_splice :: Fd -> Ptr (Int64) -> Fd -> Ptr (Int64) -> (Word32) -> Word -> IO (Int32)