You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DeliveryHint (Critical / ResyncPoint / Droppable): the codec-neutral
congestion class the relay already used per player, now public. RelayFrame::delivery_hint() classifies a frame from the existing init-cache
classification, and Server::drain_exported_relay_frames_with_hints() returns
each exported frame with its hint so a cluster relay can apply live-media
backpressure without parsing codecs. drain_exported_relay_frames() is
unchanged.
examples/bench_relay prints an additional machine-readable delivered: line
(aggregate Gbit/s and frames per viewer); existing output is unchanged.
Changed
Fan-out sends no longer allocate per player and sendmsg: the iovec array
lives on the stack (Transport::try_send_vectored takes the remaining parts
plus an offset), and Conn::send_staged_media no longer builds a window Vec per call.
StagedRelayMedia groups each player's messages while staging (a linked list
per connection in one arena) instead of sorting all frames × players
messages by connection after the fan-out; the send order per player is
unchanged.
Tests
Vectored-send tests on a socketpair (full and partial writes, resume at an
offset, more than MAX_SEND_PARTS parts, EAGAIN, empty parts, closed
peer), per-connection ordering of staged relay messages (staged and buffered
players receive byte-identical streams), and DeliveryHint classification
(H.264, E-RTMP, audio-only, script/metadata, malformed payloads).
Notes
Measured with librtmp2-server's load benchmark (500–2000 viewers) the
fan-out changes show no CPU regression and no gain beyond run-to-run noise:
the cost is dominated by the kernel TCP path. See librtmp2-server's BENCHMARKS.md.
Additive public API only (DeliveryHint, RelayFrame::delivery_hint, Server::drain_exported_relay_frames_with_hints); no FFI change.