packages feed

splice-0.1: splice.cabal

name:          splice
version:       0.1
stability:     stable on Linux, experimental on other operating systems
synopsis:      Socket to Socket Data Splicing
description:   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>
license:       BSD3
license-file:  LICENSE
author:        Cetin Sert <fusion@corsis.eu>
maintainer:    Cetin Sert <fusion@corsis.eu>
homepage:      http://fusion.corsis.eu
category:      Network
build-type:    Simple
cabal-version: >=1.2
copyright:     Copyright © 2012 Cetin Sert
tested-with:   GHC >= 7.4.3


flag portable
    description: explicitly enable portable splice implemented in Haskell
    default    : False


library

    hs-source-dirs:  src

    exposed-modules: Network.Socket.Splice

    if os(linux) && !flag(portable)
      build-depends: base    >= 4 && <= 6,
                     network >= 2 && <= 4,
                     unix    >= 2 && <= 4
      cpp-options: -DLINUX_SPLICE
      ghc-options: -O2 -O3 -fllvm -optlo-O3
    else
      build-depends: base    >= 4 && <= 6,
                     network >= 2 && <= 4
      cpp-options: -ULINUX_SPLICE
      ghc-options: -O2 -O3