HTTP-4000.4.1: A library for client-side HTTP
CopyrightSee LICENSE file
LicenseBSD
MaintainerGanesh Sittampalam <ganesh@earth.li>
Stabilityexperimental
Portabilitynon-portable (not tested)
Safe HaskellSafe-Inferred
LanguageHaskell98

Network.Stream

Description

An library for creating abstract streams. Originally part of Gray's/Bringert's HTTP module.

  • Changes by Robin Bate Boerop robin@bateboerop.name:
  • Removed unnecessary import statements.
  • Moved Debug code to StreamDebugger.hs
  • Moved Socket-related code to StreamSocket.hs.
  • Changes by Simon Foster:
  • Split Network.HTTPmodule up into to separate Network.[Stream,TCP,HTTP] modules
Synopsis

Documentation

class Stream x where #

Streams should make layering of TLS protocol easier in future, they allow reading/writing to files etc for debugging, they allow use of protocols other than TCP/IP and they allow customisation.

Instances of this class should not trim the input in any way, e.g. leave LF on line endings etc. Unless that is exactly the behaviour you want from your twisted instances ;)

Methods

readLine :: x -> IO (Result String) #

readBlock :: x -> Int -> IO (Result String) #

writeBlock :: x -> String -> IO (Result ()) #

close :: x -> IO () #

closeOnEnd #

Arguments

:: x 
-> Bool 
-> IO ()

True => shutdown the connection when response has been read / end-of-stream has been reached.

Instances

Instances details
Stream Connection # 
Instance details

Defined in Network.TCP

Stream Socket # 
Instance details

Defined in Network.StreamSocket

Stream x => Stream (StreamDebugger x) # 
Instance details

Defined in Network.StreamDebugger

data ConnError #

Instances

Instances details
Show ConnError # 
Instance details

Defined in Network.Stream

Eq ConnError # 
Instance details

Defined in Network.Stream

type Result a = Either ConnError a #

This is the type returned by many exported network functions.

bindE :: Result a -> (a -> Result b) -> Result b #

fmapE :: (a -> Result b) -> IO (Result a) -> IO (Result b) #