pub struct SessionStateMachine {
state: SessionState,
}Expand description
Pure state machine for MoQT session lifecycle. Transitions: Connecting -> SetupExchange -> Active -> Draining -> Closed.
Fields§
§state: SessionStateImplementations§
Source§impl SessionStateMachine
impl SessionStateMachine
Sourcepub fn state(&self) -> SessionState
pub fn state(&self) -> SessionState
Returns the current session state.
Sourcepub fn on_connect(&mut self) -> Result<(), SessionError>
pub fn on_connect(&mut self) -> Result<(), SessionError>
Transition: Connecting -> SetupExchange.
Sourcepub fn on_setup_complete(&mut self) -> Result<(), SessionError>
pub fn on_setup_complete(&mut self) -> Result<(), SessionError>
Transition: SetupExchange -> Active.
Sourcepub fn on_goaway(&mut self) -> Result<(), SessionError>
pub fn on_goaway(&mut self) -> Result<(), SessionError>
Transition: Active -> Draining (GOAWAY received).
Sourcepub fn on_close(&mut self) -> Result<(), SessionError>
pub fn on_close(&mut self) -> Result<(), SessionError>
Transition: SetupExchange|Active|Draining -> Closed.
draft-20 Section 3.5: “The Transport Session can be terminated at any point.”
SetupExchange is accepted, and draft-20 removes the code that made the case obvious rather than the case itself. Draft-19’s Section 3.5 listed VERSION_NEGOTIATION_FAILED (0x15), “The client didn’t offer a version supported by the server” — a failure reachable only from SetupExchange, before any session is Active. Draft-20 deleted the row, because from draft-15 on there is no version on the wire to fail to negotiate: the draft is the ALPN and a mismatch ends the TLS handshake before a MoQT session exists. What survives is every other reason a setup exchange can end — a PATH from a server, a malformed SETUP, a peer that goes away — and a session that could not close in SetupExchange could record none of them.
Connecting is still refused: no transport session has been established, so there is nothing to terminate.