Skip to main content

Module io

Module io 

Source
Available on crate feature tokio only.
Expand description

Async tokio socket adapter driving the sans-IO ingest server session over a real tokio::net::TcpStream — the Layer-2 adapter (see private/specs-verified/rtmp/rtmp-runtime/rtmp.md § Layer-2 adapter; mirrors the rtsp_runtime::io tokio adapter shape in this same workspace).

ServerSession never touches a socket: it turns inbound bytes into (reply bytes, [ServerEvent]s). This module owns the stream as a tokio_util::codec::Framed whose decoder feeds every inbound chunk to ServerSession::handle_data, writes the reply bytes back, and returns the events — no business logic beyond that plumbing.

ServerSession::handle_data buffers partial handshake/chunk input internally (see its doc comment), so unlike an RTSP or HTTP adapter this one does not need to detect message boundaries itself: any chunk size, split anywhere, is fine to feed straight through.

Every awaited IO is bounded by Timeouts (W1 SP1.3).

Structs§

AcceptedRtmpConnection
A connection AsyncRtmpServer::accept just took off its listen socket: the publisher’s address (which its erased stream cannot report) and the connection itself.
AsyncRtmpClient
A publishing RTMP client over a stream (a TcpStream by default): the adapter for ClientSession, mirroring RtmpConnection. Every awaited IO is bounded by the config’s Timeouts.
AsyncRtmpServer
A tokio::net::TcpListener that accepts inbound RTMP publishers and hands back a driven RtmpConnection per connection.
RtmpClientConfig
What an AsyncRtmpClient is configured by: the publish target and the Timeouts on every awaited I/O. Build it with RtmpClientConfig::new and with_timeouts.
RtmpConnection
One accepted RTMP connection: a stream (an erased BoxStream by default) driving a ServerSession.
RtmpServerConfig
What an AsyncRtmpServer is configured by: the sans-IO session settings and the Timeouts on every awaited I/O. Build it from RtmpServerConfig::default with with_session and with_timeouts.

Traits§

RtmpStream
An erased, transport-agnostic inbound byte stream: an accepted TCP socket, a TLS stream wrapping one, or a test’s in-memory pipe.

Type Aliases§

BoxStream
RtmpConnection’s default stream type — the erased form — so a caller naming one RtmpConnection does not name its transport.