network-mux-0.4.5.1: Multiplexing library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.Mux.Compat

Synopsis

Documentation

muxStart ∷ ∀ m mode a b. (MonadAsync m, MonadFork m, MonadLabelledSTM m, Alternative (STM m), MonadThrow (STM m), MonadTimer m, MonadMask m) ⇒ Tracer m MuxTraceMuxApplication mode m a b → MuxBearer m → m () Source #

Mux bearers

data MuxBearer m Source #

Low level access to underlying socket or pipe. There are three smart constructors:

newtype MakeBearer m fd Source #

Constructors

MakeBearer 

Fields

Defining MuxApplications

newtype MuxApplication (mode ∷ MuxMode) m a b Source #

Constructors

MuxApplication [MuxMiniProtocol mode m a b] 

newtype MiniProtocolNum Source #

The wire format includes the protocol numbers, and it's vital that these are stable. They are not necessarily dense however, as new ones are added and some old ones retired. So we use a dedicated class for this rather than reusing Enum. This also covers unrecognised protocol numbers on the decoding side.

Constructors

MiniProtocolNum Word16 

Instances

Instances details
Enum MiniProtocolNum Source # 
Instance details

Defined in Network.Mux.Types

Ix MiniProtocolNum Source # 
Instance details

Defined in Network.Mux.Types

Show MiniProtocolNum Source # 
Instance details

Defined in Network.Mux.Types

Eq MiniProtocolNum Source # 
Instance details

Defined in Network.Mux.Types

Ord MiniProtocolNum Source # 
Instance details

Defined in Network.Mux.Types

newtype MiniProtocolLimits Source #

Per Miniprotocol limits

Constructors

MiniProtocolLimits 

Fields

  • maximumIngressQueueInt

    Limit on the maximum number of bytes that can be queued in the miniprotocol's ingress queue.

data MiniProtocolDir Source #

Constructors

InitiatorDir 
ResponderDir 

Instances

Instances details
Bounded MiniProtocolDir Source # 
Instance details

Defined in Network.Mux.Types

Enum MiniProtocolDir Source # 
Instance details

Defined in Network.Mux.Types

Ix MiniProtocolDir Source # 
Instance details

Defined in Network.Mux.Types

Show MiniProtocolDir Source # 
Instance details

Defined in Network.Mux.Types

Eq MiniProtocolDir Source # 
Instance details

Defined in Network.Mux.Types

Ord MiniProtocolDir Source # 
Instance details

Defined in Network.Mux.Types

Errors

data MuxError Source #

Error type used in across the mux layer.

Constructors

MuxError 

Instances

Instances details
Exception MuxError Source # 
Instance details

Defined in Network.Mux.Trace

Generic MuxError Source # 
Instance details

Defined in Network.Mux.Trace

Associated Types

type Rep MuxErrorTypeType #

Methods

fromMuxErrorRep MuxError x #

toRep MuxError x → MuxError #

Show MuxError Source # 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrecIntMuxErrorShowS #

showMuxErrorString #

showList ∷ [MuxError] → ShowS #

type Rep MuxError Source # 
Instance details

Defined in Network.Mux.Trace

type Rep MuxError = D1 ('MetaData "MuxError" "Network.Mux.Trace" "network-mux-0.4.5.1-inplace" 'False) (C1 ('MetaCons "MuxError" 'PrefixI 'True) (S1 ('MetaSel ('Just "errorType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MuxErrorType) :*: S1 ('MetaSel ('Just "errorMsg") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))

data MuxErrorType Source #

Enumeration of error conditions.

Constructors

MuxUnknownMiniProtocol

returned by decodeMuxSDUHeader, thrown by MuxBearer.

MuxDecodeError

return by decodeMuxSDUHeader, thrown by MuxBearer.

MuxBearerClosed

thrown by MuxBearer when received a null byte.

MuxIngressQueueOverRun

thrown by demux when violating maximumIngressQueue byte limit.

MuxInitiatorOnly

thrown when data arrives on a responder channel when the mux was set up as an InitiatorApp.

MuxIOException IOException

IOException thrown by

MuxSDUReadTimeout

thrown when reading of a single SDU takes too long

MuxSDUWriteTimeout

thrown when writing a single SDU takes too long

MuxShutdown !(Maybe MuxErrorType)

Result of runMiniProtocol's completionAction in case of an error or mux being closed while a mini-protocol was still running, this is not a clean exit.

MuxCleanShutdown

Mux stopped by stopMux

Instances

Instances details
Show MuxErrorType Source # 
Instance details

Defined in Network.Mux.Trace

Eq MuxErrorType Source # 
Instance details

Defined in Network.Mux.Trace

Tracing

data MuxBearerState Source #

Constructors

Mature

MuxBearer has successfully completed the handshake.

Dead

MuxBearer is dead and the underlying bearer has been closed.

Instances

Instances details
Show MuxBearerState Source # 
Instance details

Defined in Network.Mux.Trace

Eq MuxBearerState Source # 
Instance details

Defined in Network.Mux.Trace

data WithMuxBearer peerid a Source #

Type used for tracing mux events.

Constructors

WithMuxBearer 

Fields

  • wmbPeerId ∷ !peerid

    A tag that should identify a specific mux bearer.

  • wmbEvent ∷ !a
     

Instances

Instances details
Generic (WithMuxBearer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

Associated Types

type Rep (WithMuxBearer peerid a) ∷ TypeType #

Methods

fromWithMuxBearer peerid a → Rep (WithMuxBearer peerid a) x #

toRep (WithMuxBearer peerid a) x → WithMuxBearer peerid a #

(Show peerid, Show a) ⇒ Show (WithMuxBearer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

Methods

showsPrecIntWithMuxBearer peerid a → ShowS #

showWithMuxBearer peerid a → String #

showList ∷ [WithMuxBearer peerid a] → ShowS #

type Rep (WithMuxBearer peerid a) Source # 
Instance details

Defined in Network.Mux.Trace

type Rep (WithMuxBearer peerid a) = D1 ('MetaData "WithMuxBearer" "Network.Mux.Trace" "network-mux-0.4.5.1-inplace" 'False) (C1 ('MetaCons "WithMuxBearer" 'PrefixI 'True) (S1 ('MetaSel ('Just "wmbPeerId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 peerid) :*: S1 ('MetaSel ('Just "wmbEvent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))