@@ -60,8 +60,8 @@ import Ouroboros.Network.ConnectionId
6060import Ouroboros.Network.ConnectionManager.InformationChannel
6161 (InformationChannel )
6262import Ouroboros.Network.ConnectionManager.InformationChannel qualified as InfoChannel
63- import Ouroboros.Network.ConnectionManager.State (ConnectionManagerState ,
64- ConnectionState (.. ), FreshIdSupply , MutableConnState (.. ))
63+ import Ouroboros.Network.ConnectionManager.State (ConnStateIdSupply ,
64+ ConnectionManagerState , ConnectionState (.. ), MutableConnState (.. ))
6565import Ouroboros.Network.ConnectionManager.State qualified as State
6666import Ouroboros.Network.ConnectionManager.Types
6767import Ouroboros.Network.InboundGovernor.Event (NewConnectionInfo (.. ))
@@ -402,8 +402,8 @@ with args@Arguments {
402402 classifyHandleError
403403 inboundGovernorInfoChannel
404404 k = do
405- ((freshIdSupply , stateVar, stdGenVar)
406- :: ( FreshIdSupply m
405+ ((connStateIdSupply , stateVar, stdGenVar)
406+ :: ( ConnStateIdSupply m
407407 , StrictTMVar m (ConnectionManagerState peerAddr handle handleError
408408 version m )
409409 , StrictTVar m StdGen
@@ -417,9 +417,9 @@ with args@Arguments {
417417 Just st -> Just <$> traverse (inspectTVar (Proxy :: Proxy m ) . toLazyTVar . connVar) st
418418 return (TraceString (show st'))
419419
420- freshIdSupply <- State. newFreshIdSupply (Proxy :: Proxy m )
420+ connStateIdSupply <- State. newConnStateIdSupply (Proxy :: Proxy m )
421421 stdGenVar <- newTVar (stdGen args)
422- return (freshIdSupply , v, stdGenVar)
422+ return (connStateIdSupply , v, stdGenVar)
423423
424424 let readState
425425 :: STM m (State. ConnMap peerAddr AbstractState )
@@ -456,7 +456,7 @@ with args@Arguments {
456456 WithInitiatorMode
457457 OutboundConnectionManager {
458458 ocmAcquireConnection =
459- acquireOutboundConnectionImpl freshIdSupply stateVar
459+ acquireOutboundConnectionImpl connStateIdSupply stateVar
460460 stdGenVar outboundHandler,
461461 ocmReleaseConnection =
462462 releaseOutboundConnectionImpl stateVar stdGenVar
@@ -471,7 +471,7 @@ with args@Arguments {
471471 WithResponderMode
472472 InboundConnectionManager {
473473 icmIncludeConnection =
474- includeInboundConnectionImpl freshIdSupply stateVar
474+ includeInboundConnectionImpl connStateIdSupply stateVar
475475 inboundHandler,
476476 icmReleaseConnection =
477477 releaseInboundConnectionImpl stateVar,
@@ -492,14 +492,14 @@ with args@Arguments {
492492 WithInitiatorResponderMode
493493 OutboundConnectionManager {
494494 ocmAcquireConnection =
495- acquireOutboundConnectionImpl freshIdSupply stateVar
495+ acquireOutboundConnectionImpl connStateIdSupply stateVar
496496 stdGenVar outboundHandler,
497497 ocmReleaseConnection =
498498 releaseOutboundConnectionImpl stateVar stdGenVar
499499 }
500500 InboundConnectionManager {
501501 icmIncludeConnection =
502- includeInboundConnectionImpl freshIdSupply stateVar
502+ includeInboundConnectionImpl connStateIdSupply stateVar
503503 inboundHandler,
504504 icmReleaseConnection =
505505 releaseInboundConnectionImpl stateVar,
@@ -844,7 +844,7 @@ with args@Arguments {
844844
845845 includeInboundConnectionImpl
846846 :: HasCallStack
847- => FreshIdSupply m
847+ => ConnStateIdSupply m
848848 -> StrictTMVar m (ConnectionManagerState peerAddr handle handleError version m )
849849 -> ConnectionHandlerFn handlerTrace socket peerAddr handle handleError version versionData m
850850 -> Word32
@@ -859,7 +859,7 @@ with args@Arguments {
859859 -> ConnectionId peerAddr
860860 -- ^ connection id used as an identifier of the resource
861861 -> m (Connected peerAddr handle handleError )
862- includeInboundConnectionImpl freshIdSupply
862+ includeInboundConnectionImpl connStateIdSupply
863863 stateVar
864864 handler
865865 hardLimit
@@ -905,7 +905,7 @@ with args@Arguments {
905905 case v0 of
906906 Nothing -> do
907907 -- 'Accepted'
908- v <- State. newMutableConnState (remoteAddress connId) freshIdSupply connState'
908+ v <- State. newMutableConnState (remoteAddress connId) connStateIdSupply connState'
909909 labelTVar (connVar v) (" conn-state-" ++ show connId)
910910 return (v, Nothing )
911911 Just v -> do
@@ -933,8 +933,8 @@ with args@Arguments {
933933 InboundState {} -> writeTVar (connVar v) connState'
934934 $> assert False v
935935
936- TerminatingState {} -> State. newMutableConnState (remoteAddress connId) freshIdSupply connState'
937- TerminatedState {} -> State. newMutableConnState (remoteAddress connId) freshIdSupply connState'
936+ TerminatingState {} -> State. newMutableConnState (remoteAddress connId) connStateIdSupply connState'
937+ TerminatedState {} -> State. newMutableConnState (remoteAddress connId) connStateIdSupply connState'
938938
939939 labelTVar (connVar v') (" conn-state-" ++ show connId)
940940 return (v', Just connState0')
@@ -1318,7 +1318,7 @@ with args@Arguments {
13181318 -> DiffusionMode
13191319 -> peerAddr
13201320 -> m (Connected peerAddr handle handleError )
1321- acquireOutboundConnectionImpl freshIdSupply stateVar stdGenVar handler diffusionMode peerAddr = do
1321+ acquireOutboundConnectionImpl connStateIdSupply stateVar stdGenVar handler diffusionMode peerAddr = do
13221322 let provenance = Outbound
13231323 traceWith tracer (TrIncludeConnection provenance peerAddr)
13241324 (trace, mutableConnState@ MutableConnState { connVar }
@@ -1440,7 +1440,7 @@ with args@Arguments {
14401440 let connState' = ReservedOutboundState
14411441 (mutableConnState :: MutableConnState peerAddr handle handleError
14421442 version m)
1443- <- State. newMutableConnState peerAddr freshIdSupply connState'
1443+ <- State. newMutableConnState peerAddr freshConnIdSupply connState'
14441444 -- TODO: label `connVar` using 'ConnectionId'
14451445 labelTVar (connVar mutableConnState) (" conn-state-" ++ show peerAddr)
14461446
0 commit comments