ouroboros-network-framework
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Server2

Description

Server implementation based on ConnectionManager

This module should be imported qualified.

Synopsis

Documentation

data Arguments (muxMode :: Mode) socket initiatorCtx peerAddr versionData versionNumber bytes (m :: Type -> Type) a b Source #

Server static configuration.

Constructors

Arguments 

Fields

Run server

with Source #

Arguments

:: forall (muxMode :: Mode) socket initiatorCtx peerAddr versionData versionNumber m a b x. (Alternative (STM m), MonadAsync m, MonadDelay m, MonadCatch m, MonadEvaluate m, MonadLabelledSTM m, MonadMask m, MonadThrow (STM m), MonadTime m, MonadTimer m, HasResponder muxMode ~ 'True, Ord peerAddr, Show peerAddr) 
=> Arguments muxMode socket initiatorCtx peerAddr versionData versionNumber ByteString m a b

record which holds all server arguments

-> (Async m Void -> m (PublicState peerAddr versionData) -> m x)

a callback which receives a handle to inbound governor thread and can read PublicState.

Note that as soon as the callback returns, all threads run by the server will be stopped.

-> m x 

Run the server, which consists of the following components:

  • inbound governor, it corresponds to p2p-governor on outbound side
  • accept loop(s), one per given ip address. We support up to one ipv4 address and up to one ipv6 address, i.e. an ipv6 enabled node will run two accept loops on listening on different addresses with shared inbound governor.

The server can be run in either of two MuxMode-es:

  • InitiatorResponderMode
  • ResponderMode

The first one is used in data diffusion for Node-To-Node protocol, while the other is useful for running a server for the Node-To-Client protocol.

Trace

data Trace peerAddr Source #

Constructors

TrAcceptConnection peerAddr 
TrAcceptError SomeException 
TrAcceptPolicyTrace AcceptConnectionsPolicyTrace 
TrServerStarted [peerAddr] 
TrServerStopped 
TrServerError SomeException

similar to TrAcceptConnection but it is logged once the connection is handed to inbound connection manager, e.g. after handshake negotiation.

Instances

Instances details
Show peerAddr => Show (Trace peerAddr) Source # 
Instance details

Defined in Ouroboros.Network.Server2

Methods

showsPrec :: Int -> Trace peerAddr -> ShowS #

show :: Trace peerAddr -> String #

showList :: [Trace peerAddr] -> ShowS #

data AcceptConnectionsPolicyTrace Source #

Trace for the AcceptConnectionsLimit policy.

data RemoteSt Source #

Remote connection state tracked by inbound protocol governor.

This type is used for tracing.

Instances

Instances details
Show RemoteSt Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor.State

Eq RemoteSt Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor.State

type RemoteTransition = Transition' (Maybe RemoteSt) Source #

Nothing represents uninitialised state.