box-socket-0.4.1: Box websockets
Safe HaskellSafe-Inferred
LanguageHaskell2010

Box.TCP

Description

TCP Boxes.

Synopsis

Documentation

data TCPConfig Source #

TCP configuration

>>> defaultTCPConfig
TCPConfig {host = "127.0.0.1", port = "3566"}

Constructors

TCPConfig 

Fields

Instances

Instances details
Generic TCPConfig Source # 
Instance details

Defined in Box.TCP

Associated Types

type Rep TCPConfig :: Type -> Type #

Show TCPConfig Source # 
Instance details

Defined in Box.TCP

Eq TCPConfig Source # 
Instance details

Defined in Box.TCP

type Rep TCPConfig Source # 
Instance details

Defined in Box.TCP

type Rep TCPConfig = D1 ('MetaData "TCPConfig" "Box.TCP" "box-socket-0.4.1-LWqRyRmzNmq1mf13crzbPE" 'False) (C1 ('MetaCons "TCPConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "host") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "port") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

data Env Source #

An active TCP environment

Constructors

Env 

Fields

new Source #

Arguments

:: TCPConfig

Configuration

-> IO Env 

Connects to a server with no screen or file dump.

close :: Env -> IO () Source #

close an Env

tcpResponder :: TCPConfig -> (ByteString -> IO ByteString) -> IO () Source #

A server that explicitly responds to client messages.

tcpSender :: TCPConfig -> Emitter IO ByteString -> IO () Source #

A server independent of incoming messages.

tcpStdClient :: TCPConfig -> IO () Source #

A TCP client connected to stdin

testHarness :: IO () -> IO () Source #

test harness wrapping an action with a "q" escape.

testResponder :: IO () Source #

"echo: " <> Responder

testServerSender :: IO () Source #

Test server.