Expand description
Peer session lifecycle management with per-peer caps, state machine, and idle eviction.
This module provides PeerSessionManager, which tracks active sessions per peer,
manages session lifecycle state transitions, enforces per-peer session caps, and
applies global idle timeouts based on logical tick counts rather than wall-clock time.
§Session Lifecycle
Initiated → Established → Closing → Closed
↓ ↑
└────────────────────────┘ (idle eviction marks Closed directly)§Example
use ipfrs_network::session_manager::{
PeerSessionManager, SessionManagerConfig, SessionDirection,
};
let config = SessionManagerConfig::default();
let mut mgr = PeerSessionManager::new(config);
let sid = mgr
.open_session("peer-alpha", SessionDirection::Inbound, 0)
.expect("open session");
assert!(mgr.get_session(sid).is_some());Structs§
- Peer
Session Entry - A single tracked peer session.
- Peer
Session Manager - Manages the lifecycle of peer sessions with per-peer caps and idle eviction.
- Session
Manager Config - Configuration for
PeerSessionManager. - Session
Manager Stats - Aggregated statistics snapshot for
PeerSessionManager.
Enums§
- Peer
Session State - Lifecycle state of a single peer session.
- Session
Direction - Direction in which a session was initiated.
Type Aliases§
- Peer
Session - Public alias for
PeerSessionEntrymatching the required API surface. - Session
State - Public alias for
PeerSessionStatematching the required API surface.