Expand description
Async real-socket IO adapter over the sans-IO engine — RFC 2326 transport.
The sans-IO ClientSession / ServerSession engines never touch a
socket: they turn method calls into request/response bytes and consume
inbound bytes into typed events. This module is the thin layer that
actually moves those bytes over a tokio socket — it owns the stream,
writes what the session produces, reads the peer’s reply (buffering partial
reads until a full RTSP message or interleaved $-frame parses, per §10.12),
feeds it back through ClientSession::handle_data /
ServerSession::handle_request, and returns the resulting events. The
engine stays pure; the adapter is pure plumbing.
Both the client and server are generic over the stream type
(S: AsyncRead + AsyncWrite + Unpin), so the identical driver logic runs over
a plain tokio::net::TcpStream and over a TLS stream.
§rtsp:// vs rtsps://
Plain RTSP (rtsp://) is carried over TCP on default port 554
(RTSP_DEFAULT_PORT). RTSP-over-TLS (rtsps://) wraps the TCP stream in a
TLS session before any RTSP is exchanged and uses default port 322
(RTSPS_DEFAULT_PORT, per the IANA rtsps assignment). The TLS entry
points (AsyncRtspClient::connect_tls, AsyncRtspServer::accept_tls) are
gated behind the tls feature; everything else is behind tokio.
Structs§
- Async
Rtsp Client - An async RTSP client that owns a socket and drives a
ClientSession. - Async
Rtsp Server - An async RTSP server connection that owns a socket and drives a
ServerSession.
Constants§
- RTSPS_
DEFAULT_ PORT - Default TCP port for
rtsps://(RTSP over TLS; IANArtsps). - RTSP_
DEFAULT_ PORT - Default TCP port for
rtsp://(RFC 2326 §1 / IANArtsp).
Functions§
- default_
tls_ client_ config - Builds a
rustls::ClientConfigtrusting thewebpki-rootspublic-CA bundle (the default trust store forrtsps://to a well-known server).