splice-0.1: Socket to Socket Data Splicing

Safe HaskellSafe-Infered

Network.Socket.Splice

Description

 

Synopsis

Documentation

zeroCopySource

Arguments

:: Bool

True: system calls; otherwise: portable.

Indicates whether loopSplice uses zero copy system calls or the portable user mode Haskell substitue implementation.

loopSpliceSource

Arguments

:: Length

Splice length

-> Socket

Source socket

-> Socket

Target socket

-> IO () 

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.