Safe Haskell | None |
---|---|
Language | Haskell2010 |
Server implementation based on ConnectionManager
This module should be imported qualified.
Synopsis
- data PublicState peerAddr versionData = PublicState {
- inboundDuplexPeers :: !(Map peerAddr versionData)
- remoteStateMap :: Map (ConnectionId peerAddr) RemoteSt
- data Arguments (muxMode :: Mode) socket initiatorCtx peerAddr versionNumber versionData (m :: Type -> Type) a b = Arguments {
- transitionTracer :: Tracer m (RemoteTransitionTrace peerAddr)
- tracer :: Tracer m (Trace peerAddr)
- debugTracer :: Tracer m (Debug peerAddr versionData)
- connectionDataFlow :: versionData -> DataFlow
- infoChannel :: InboundGovernorInfoChannel muxMode initiatorCtx peerAddr versionData ByteString m a b
- idleTimeout :: Maybe DiffTime
- connectionManager :: MuxConnectionManager muxMode socket initiatorCtx (ResponderContext peerAddr) peerAddr versionData versionNumber ByteString m a b
- with :: forall (muxMode :: Mode) socket initiatorCtx peerAddr versionData versionNumber m a b x. (Alternative (STM m), MonadAsync m, MonadCatch m, MonadEvaluate m, MonadLabelledSTM m, MonadThrow m, MonadThrow (STM m), MonadTime m, MonadTimer m, MonadMask m, Ord peerAddr, HasResponder muxMode ~ 'True) => Arguments muxMode socket initiatorCtx peerAddr versionNumber versionData m a b -> (Async m Void -> m (PublicState peerAddr versionData) -> m x) -> m x
- data Trace peerAddr
- = TrNewConnection !Provenance !(ConnectionId peerAddr)
- | TrResponderRestarted !(ConnectionId peerAddr) !MiniProtocolNum
- | TrResponderStartFailure !(ConnectionId peerAddr) !MiniProtocolNum !SomeException
- | TrResponderErrored !(ConnectionId peerAddr) !MiniProtocolNum !SomeException
- | TrResponderStarted !(ConnectionId peerAddr) !MiniProtocolNum
- | TrResponderTerminated !(ConnectionId peerAddr) !MiniProtocolNum
- | TrPromotedToWarmRemote !(ConnectionId peerAddr) !(OperationResult AbstractState)
- | TrPromotedToHotRemote !(ConnectionId peerAddr)
- | TrDemotedToWarmRemote !(ConnectionId peerAddr)
- | TrDemotedToColdRemote !(ConnectionId peerAddr) !(OperationResult DemotedToColdRemoteTr)
- | TrWaitIdleRemote !(ConnectionId peerAddr) !(OperationResult AbstractState)
- | TrMuxCleanExit !(ConnectionId peerAddr)
- | TrMuxErrored !(ConnectionId peerAddr) SomeException
- | TrInboundGovernorCounters !Counters
- | TrRemoteState !(Map (ConnectionId peerAddr) RemoteSt)
- | TrUnexpectedlyFalseAssertion !(IGAssertionLocation peerAddr)
- | TrInboundGovernorError !SomeException
- | TrMaturedConnections !(Set peerAddr) !(Set peerAddr)
- | TrInactive ![(peerAddr, Time)]
- data Debug peerAddr versionData = Debug (State muxMode initiatorCtx peerAddr versionData m a b)
- data RemoteSt
- type RemoteTransition = Transition' (Maybe RemoteSt)
- type RemoteTransitionTrace peerAddr = TransitionTrace' peerAddr (Maybe RemoteSt)
- data AcceptConnectionsPolicyTrace
- data Transition' state = Transition {}
- data TransitionTrace' id state = TransitionTrace {
- ttPeerAddr :: id
- ttTransition :: Transition' state
- maturedPeers :: Ord peerAddr => Time -> OrdPSQ peerAddr Time versionData -> (Map peerAddr versionData, OrdPSQ peerAddr Time versionData)
Run Inbound Protocol Governor
data PublicState peerAddr versionData Source #
Public inbound governor state.
PublicState | |
|
data Arguments (muxMode :: Mode) socket initiatorCtx peerAddr versionNumber versionData (m :: Type -> Type) a b Source #
Arguments | |
|
with :: forall (muxMode :: Mode) socket initiatorCtx peerAddr versionData versionNumber m a b x. (Alternative (STM m), MonadAsync m, MonadCatch m, MonadEvaluate m, MonadLabelledSTM m, MonadThrow m, MonadThrow (STM m), MonadTime m, MonadTimer m, MonadMask m, Ord peerAddr, HasResponder muxMode ~ 'True) => Arguments muxMode socket initiatorCtx peerAddr versionNumber versionData m a b -> (Async m Void -> m (PublicState peerAddr versionData) -> m x) -> m x 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 Mode
-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
Remote connection state tracked by inbound protocol governor.
This type is used for tracing.
type RemoteTransition = Transition' (Maybe RemoteSt) Source #
Nothing
represents uninitialised state.
type RemoteTransitionTrace peerAddr = TransitionTrace' peerAddr (Maybe RemoteSt) Source #
data AcceptConnectionsPolicyTrace Source #
Trace for the AcceptConnectionsLimit
policy.
ServerTraceAcceptConnectionRateLimiting DiffTime Int | |
ServerTraceAcceptConnectionHardLimit Word32 | |
ServerTraceAcceptConnectionResume Int |
Instances
Re-exports
data Transition' state Source #
Instances
Functor Transition' Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types fmap :: (a -> b) -> Transition' a -> Transition' b # (<$) :: a -> Transition' b -> Transition' a # | |
Show state => Show (Transition' state) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types showsPrec :: Int -> Transition' state -> ShowS # show :: Transition' state -> String # showList :: [Transition' state] -> ShowS # | |
Eq state => Eq (Transition' state) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types (==) :: Transition' state -> Transition' state -> Bool # (/=) :: Transition' state -> Transition' state -> Bool # |
data TransitionTrace' id state Source #
TransitionTrace | |
|
Instances
Functor (TransitionTrace' id) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types fmap :: (a -> b) -> TransitionTrace' id a -> TransitionTrace' id b # (<$) :: a -> TransitionTrace' id b -> TransitionTrace' id a # | |
(Show peerAddr, Show state) => Show (TransitionTrace' peerAddr state) Source # | |
Defined in Ouroboros.Network.ConnectionManager.Types showsPrec :: Int -> TransitionTrace' peerAddr state -> ShowS # show :: TransitionTrace' peerAddr state -> String # showList :: [TransitionTrace' peerAddr state] -> ShowS # |