happstack-server-6.6.2: Web related tools and services.

Portabilitynon-portable (not tested)
Stabilityexperimental
Maintainerbjorn@bringert.net
Safe HaskellNone

Happstack.Server.HTTPClient.Stream

Contents

Description

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

  • Changes by Simon Foster: - Split module up into to sepearate Network.[Stream,TCP,HTTP] modules

Synopsis

Streams

data Debug x Source

Allows stream logging. Refer to debugStream below.

Instances

Stream x => Stream (Debug x) 

class Stream x whereSource

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)Source

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

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

close :: x -> IO ()Source

Instances

debugStream :: Stream a => String -> a -> IO (Debug a)Source

Wraps a stream with logging I/O, the first argument is a filename which is opened in AppendMode.

Errors

data ConnError Source

Constructors

ErrorReset 
ErrorClosed 
ErrorParse String 
ErrorMisc String 

Instances

Eq ConnError 
Show ConnError 

type Result a = Either ConnError aSource

This is the type returned by many exported network functions.

handleSocketError :: Socket -> SomeException -> IO (Result a)Source

bindE :: Either ConnError a -> (a -> Either ConnError b) -> Either ConnError bSource

myrecv :: Socket -> Int -> IO StringSource