#[non_exhaustive]pub struct ServerConfig {
pub chunk_size: u32,
pub window_ack_size: u32,
pub peer_bandwidth: u32,
pub expected_stream_key: Option<String>,
pub max_in_progress_bytes: usize,
}Expand description
Configuration for a ServerSession.
#[non_exhaustive]: fields may grow (e.g. a future app gate alongside
expected_stream_key). Construct via ServerConfig::default plus the
with_* builder methods rather than a struct literal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.chunk_size: u32Outbound chunk size advertised (and adopted) on connect (§5.4.1).
window_ack_size: u32Window Acknowledgement Size advertised on connect (§5.4.4); also
the initial threshold for this session’s own inbound Ack accounting
(§5.4.3), until a peer WindowAckSize/SetPeerBandwidth updates it.
peer_bandwidth: u32Set Peer Bandwidth value advertised on connect (§5.4.5).
expected_stream_key: Option<String>If set, publish’s stream key (publishing name) must match this
value exactly or the publish is rejected: onStatus
NetStream.Publish.BadName, and no Publish/Media events are
emitted for that connection.
None (the default) admits any publisher. A listener reachable
from an untrusted network must set a key (or authenticate the
publisher some other way before handing bytes to this session).
max_in_progress_bytes: usizeCeiling on the total payload bytes this session’s
ChunkAssembler may buffer across all in-progress messages
at once (#1108/RTMP-W1). Per-message and per-csid bounds alone
allowed MAX_MESSAGE_LEN × MAX_CSIDS (512 MiB) of incomplete,
never-completing bytes per connection; this bounds the product.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn with_expected_stream_key(
self,
expected_stream_key: Option<String>,
) -> Self
pub fn with_expected_stream_key( self, expected_stream_key: Option<String>, ) -> Self
Set ServerConfig::expected_stream_key. #[non_exhaustive] forbids
struct-literal construction of this type from outside the crate, so
this (plus the other with_* builders below) is how a caller
customises a field starting from ServerConfig::default.
Sourcepub fn with_chunk_size(self, chunk_size: u32) -> Self
pub fn with_chunk_size(self, chunk_size: u32) -> Self
Sourcepub fn with_window_ack_size(self, window_ack_size: u32) -> Self
pub fn with_window_ack_size(self, window_ack_size: u32) -> Self
Sourcepub fn with_peer_bandwidth(self, peer_bandwidth: u32) -> Self
pub fn with_peer_bandwidth(self, peer_bandwidth: u32) -> Self
Sourcepub fn with_max_in_progress_bytes(self, max_in_progress_bytes: usize) -> Self
pub fn with_max_in_progress_bytes(self, max_in_progress_bytes: usize) -> Self
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§impl Debug for ServerConfig
Manual Debug: the expected stream key is the ingest secret and never
renders (issue #1142).
impl Debug for ServerConfig
Manual Debug: the expected stream key is the ingest secret and never
renders (issue #1142).
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ServerConfig
serde only.