pub struct ClientConfig {
pub address_family: AddressFamily,
pub socket: SocketConfig,
pub request: SessionRequest,
pub open: OpenPolicy,
pub auth: Authentication,
pub probe_timeout: Duration,
pub max_pending_probes: usize,
}Expand description
Configuration for opening and running an IRTT client session.
This type describes both the protocol parameters sent in the IRTT open
request and the local client behavior used to drive the UDP socket. Values
that are negotiated by the server are available after opening the session
through NegotiationResult.
§Example
Configure a finite run with larger probes and accept documented server
restrictions. Use duration: None for continuous mode, or
RunMode::NoTest for negotiation without probes.
use std::time::Duration;
use irtt_client::{ClientConfig, NegotiationPolicy, OpenPolicy, SessionRequest};
let config = ClientConfig {
request: SessionRequest {
duration: Some(Duration::from_secs(10)),
interval: Duration::from_millis(250),
length: 1200,
..SessionRequest::default()
},
open: OpenPolicy {
negotiation: NegotiationPolicy::Loose,
..OpenPolicy::default()
},
..ClientConfig::default()
};
assert_eq!(config.request.duration, Some(Duration::from_secs(10)));
assert_eq!(config.request.interval, Duration::from_millis(250));
assert_eq!(config.request.length, 1200);Fields§
§address_family: AddressFamilyRemote address families allowed during resolution and socket creation.
socket: SocketConfigLocal UDP socket properties.
request: SessionRequestProtocol and session values requested from the server.
open: OpenPolicyOpen retry timeouts and negotiation policy.
auth: AuthenticationConcrete authentication for open, echo, and close packets.
HMAC peers must use the same key. An empty HMAC key remains authenticated.
probe_timeout: DurationTime after sending a probe before the client reports it as lost.
This timeout is local client behavior; it is not negotiated with the server. It must be greater than zero.
max_pending_probes: usizeMaximum number of probes tracked as pending/timed-out/completed.
This bounds memory used for reply classification and must be greater than zero. A very small value can reject sends when replies are still outstanding.