pub struct StreamConnectConfig {
pub session_id: String,
pub reconnect: ReconnectConfig,
pub idle_timeout: Option<Duration>,
pub keepalive_interval: Option<Duration>,
}Fields§
§session_id: StringIdentifies this connection in StreamControlEvents. Never sent to
the server — each subscription carries its own requestId.
reconnect: ReconnectConfig§idle_timeout: Option<Duration>Tear down and reconnect if no frame arrives from the server within this
window. Defaults to 60 seconds; None disables the check.
Without this, a TCP connection that dies silently (no FIN, no RST — the common case behind NAT timeouts and load-balancer drops) leaves the stream blocked forever and reconnect never fires.
keepalive_interval: Option<Duration>Send a WebSocket ping this often. Defaults to 20 seconds; None
disables it.
The pong it draws counts as traffic for idle_timeout, so a market
that simply has nothing to report is not mistaken for a dead socket.
Implementations§
Source§impl StreamConnectConfig
impl StreamConnectConfig
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_reconnect(self, reconnect: ReconnectConfig) -> Self
Sourcepub fn with_idle_timeout(self, idle_timeout: Option<Duration>) -> Self
pub fn with_idle_timeout(self, idle_timeout: Option<Duration>) -> Self
Set the idle timeout. Pass None to disable dead-connection detection.
Sourcepub fn with_keepalive_interval(
self,
keepalive_interval: Option<Duration>,
) -> Self
pub fn with_keepalive_interval( self, keepalive_interval: Option<Duration>, ) -> Self
Set the keepalive ping interval. Pass None to stop sending pings.
Trait Implementations§
Source§impl Clone for StreamConnectConfig
impl Clone for StreamConnectConfig
Source§fn clone(&self) -> StreamConnectConfig
fn clone(&self) -> StreamConnectConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more