    module Happstack.Server.Internal.TimeoutIO
        ( TimeoutIO(..)
        ) where

    import qualified Data.ByteString.Char8          as B
    import qualified Data.ByteString.Lazy.Char8     as L
    import Happstack.Server.Internal.TimeoutManager (Handle)
    import Network.Socket.SendFile                  (ByteCount, Offset)

    -- |TimeoutIO is a record which abstracts out all the network IO
    -- functions needed by the request handling loop. This allows use to
    -- use the same event loop for handle both http:// and https://.
    data TimeoutIO = TimeoutIO
        { TimeoutIO -> Handle
    toHandle      :: Handle
        , TimeoutIO -> ByteString -> IO ()
    toPutLazy     :: L.ByteString -> IO ()
        , TimeoutIO -> ByteString -> IO ()
    toPut         :: B.ByteString -> IO ()
        , TimeoutIO -> IO (Maybe ByteString)
    toGet         :: IO (Maybe B.ByteString)
        , TimeoutIO -> IO ByteString
    toGetContents :: IO L.ByteString
        , TimeoutIO -> FilePath -> Offset -> Offset -> IO ()
    toSendFile    :: FilePath -> Offset -> ByteCount -> IO ()
        , TimeoutIO -> IO ()
    toShutdown    :: IO ()
        , TimeoutIO -> Bool
    toSecure      :: Bool
        }