ouroboros-network-framework-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Server2

Description

Server implementation based on ConnectionManager

Synopsis

Documentation

data ServerArguments (muxMode ∷ MuxMode) socket peerAddr versionNumber bytes m a b Source #

Server static configuration.

Constructors

ServerArguments 

Fields

newtype InboundGovernorObservableState Source #

Currently only StdGen, but in the future this will be extended to a record which contains some useful statistics about peers to support more advances prune strategies (see. PruneStrategy).

Constructors

InboundGovernorObservableState 

Fields

newObservableStateVar ∷ MonadLabelledSTM m ⇒ StdGen → m (StrictTVar m InboundGovernorObservableState) Source #

Create new observable state StrictTVar.

newObservableStateVarIOIO (StrictTVar IO InboundGovernorObservableState) Source #

Using the global StdGen.

newObservableStateVarFromSeed ∷ MonadLabelledSTM m ⇒ Int → m (StrictTVar m InboundGovernorObservableState) Source #

Useful for testing, it is using mkStdGen.

Run server

run ∷ ∀ muxMode socket peerAddr versionNumber m a b. (MonadAsync m, MonadCatch m, MonadEvaluate m, MonadLabelledSTM m, MonadMask m, MonadThrow (STM m), MonadTime m, MonadTimer m, HasResponder muxMode ~ True, Ord peerAddr, Show peerAddr) ⇒ ServerArguments muxMode socket peerAddr versionNumber ByteString m a b → m Void Source #

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:

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 ServerTrace 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 (ServerTrace peerAddr) Source # 
Instance details

Defined in Ouroboros.Network.Server2

Methods

showsPrecIntServerTrace peerAddr → ShowS Source #

showServerTrace peerAddr → String Source #

showList ∷ [ServerTrace peerAddr] → ShowS Source #

data AcceptConnectionsPolicyTrace Source #

Trace for the AcceptConnectionsLimit policy.

data RemoteSt Source #

Remote connection state tracked by inbound protocol governor.

Instances

Instances details
Eq RemoteSt Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor

Show RemoteSt Source # 
Instance details

Defined in Ouroboros.Network.InboundGovernor

type RemoteTransition = Transition' (Maybe RemoteSt) Source #

Nothing represents unitialised state.

ControlChannel