Skip to main content

Module client

Module client 

Source
Expand description

Client-side RTSP session engine — RFC 2326 Appendix A.1.

ClientSession is a sans-IO driver: request-builder methods return the outbound bytes to send, and ClientSession::handle_data consumes inbound bytes (responses and interleaved $ frames) and returns typed ClientEvents. It holds the session state, the next CSeq, the negotiated Session id and timeout, optional credentials, and the digest Authenticator.

Behaviour implemented here (see docs/state-machines.md, docs/methods-and-status.md, docs/auth.md):

  • Request builders reject any method not valid in the current state (Error::MethodNotValidInState) before emitting bytes.
  • Every request carries an incrementing CSeq, the Session id once known, and (once authenticated) a freshly-computed Authorization header.
  • A 2xx response advances the state per the §A.1 table; a 3xx resets it to Init.
  • A 401 with configured credentials transparently re-sends the request with Authorization (a new CSeq), including on stale=true.
  • The Session id and timeout are captured from the SETUP response.
  • Interleaved frames are surfaced as ClientEvent::MediaData.

Structs§

ClientSession
A driveable RTSP client session (RFC 2326 §A.1).

Enums§

ClientEvent
An event produced by ClientSession::handle_data.