Control.Pipe.Network
- type Application = Producer ByteString (ResourceT IO) () -> Consumer ByteString (ResourceT IO) () -> ResourceT IO ()
- sourceSocket :: MonadIO m => Socket -> Producer ByteString m ()
- sinkSocket :: MonadIO m => Socket -> Consumer ByteString m r
- data  ServerSettings  = ServerSettings {- serverPort :: Int
- serverHost :: Maybe String
 
- runTCPServer :: ServerSettings -> Application -> IO ()
- data  ClientSettings  = ClientSettings {- clientPort :: Int
- clientHost :: String
 
- runTCPClient :: ClientSettings -> Application -> IO ()
Documentation
type Application = Producer ByteString (ResourceT IO) () -> Consumer ByteString (ResourceT IO) () -> ResourceT IO ()
A simple TCP application. It takes two arguments: the Source to read
 input data from, and the Sink to send output data to.
sourceSocket :: MonadIO m => Socket -> Producer ByteString m ()
Stream data from the socket.
sinkSocket :: MonadIO m => Socket -> Consumer ByteString m r
Stream data to the socket.
data ServerSettings
Settings for a TCP server. It takes a port to listen on, and an optional hostname to bind to.
Constructors
| ServerSettings | |
| Fields 
 | |
runTCPServer :: ServerSettings -> Application -> IO ()
Run an Application with the given settings. This function will create a
 new listening socket, accept connections on it, and spawn a new thread for
 each connection.
data ClientSettings
Settings for a TCP client, specifying how to connect to the server.
Constructors
| ClientSettings | |
| Fields 
 | |
runTCPClient :: ClientSettings -> Application -> IO ()
Run an Application by connecting to the specified server.