pub struct SessionConfig {
pub queue_capacity: usize,
pub apdu_timeout_ms: u64,
pub apdu_retries: u8,
pub max_apdu_length: u16,
pub read_work_limit: usize,
pub min_request_interval_ms: u64,
}Expand description
Session tuning (bounded queues, client timers, the responder’s read work limit).
Typed at the public boundary: every field is validated where it matters
(queue_capacity == 0, read_work_limit == 0 or a
min_request_interval_ms past an hour fails EndpointSession::new;
APDU/timer values flow into the client role config unchanged).
use bacnet_endpoint::session::SessionConfig;
let config = SessionConfig::default();
assert!(config.queue_capacity > 0);
assert_eq!(config.max_apdu_length, 480);
assert_eq!(config.read_work_limit, 256);
assert_eq!(config.min_request_interval_ms, 0);Fields§
§queue_capacity: usizeBounded capacity for each ingress queue + egress channel.
Must be greater than zero; EndpointSession::new returns
Error::Encoding otherwise.
apdu_timeout_ms: u64Client APDU timeout (ms).
apdu_retries: u8Client APDU retries.
max_apdu_length: u16Client max APDU length.
Standalone default is 480. Composing a
DeviceIdentity via
device overrides this at start with the
identity’s ceiling resolved against the transport’s stable local
receive capacity (480 for standard MS/TP, 1476 for extended MS/TP).
read_work_limit: usizeResult rows one ReadProperty served by the server role may expand (default 256).
The endpoint’s counterpart of the server’s
ReadPropertyMultipleBudget::max_result_elements,
with the same default. A read counts its own row, and a Group’s
Present_Value adds one row per member property after ALL, REQUIRED
and OPTIONAL expand. A read past the limit is answered with an Abort
carrying OUT_OF_RESOURCES before any member is read.
Must be greater than zero; EndpointSession::new returns
Error::Encoding otherwise.
min_request_interval_ms: u64Least time, in milliseconds, between the client role’s confirmed
requests to one destination (default 0: no pacing), measured as
ClientConfig::min_request_interval_ms says for BACnetClient
(#1542).
Only new confirmed requests wait: a retry keeps its request’s turn,
and replies, notifications and unconfirmed requests go at once.
Stopping or dropping the session ends a wait at once with the
shutdown error. At
most MAX_MIN_REQUEST_INTERVAL_MS,
an hour; EndpointSession::new returns Error::Encoding past it.