#[non_exhaustive]pub struct Config {Show 13 fields
pub block_check: BlockCheck,
pub eight_bit_clean: bool,
pub repeat: bool,
pub timeout: Duration,
pub retries: u32,
pub first_packet_retries: Option<u32>,
pub first_packet_nak_window: Option<Duration>,
pub first_packet_nak_grace: Option<Duration>,
pub first_packet_nak_byte_time: Option<Duration>,
pub packet_pause: Duration,
pub nak_grace: Duration,
pub linger: Duration,
pub max_size: Option<usize>,
}Expand description
Tunables of a Client.
Non-exhaustive: start from Config::default and set the fields you
need.
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.block_check: BlockCheckBlock check we offer in our Send-Init (default type 3).
eight_bit_clean: booltrue (default): we offer QBIN Y (no 8th-bit prefixing unless the peer
asks); false: we ask for 8th-bit prefixing with &.
repeat: booltrue (default): we offer REPT ~; false: no repeat compression.
timeout: DurationOur receive timeout per packet (default 20 s).
retries: u32Retransmissions per packet before giving up (default 5).
first_packet_retries: Option<u32>Retransmissions of the packet that starts a server transaction (the
C, R, G or I) while no reply to it has arrived; None
(default) means Config::retries. Once the server answers (its
S), Config::retries applies to the rest of the transaction.
Some(0) sends a host command exactly once: a server cannot tell a
resent C from a new one and runs it again, while a damaged reply
packet is still re-requested.
first_packet_nak_window: Option<Duration>Immediate-NAK window for the first packet (default None: off).
When Config::first_packet_retries forbids another resend of the
packet that starts a transaction, a NAK of it (seq 0) that arrives
within this window after Client::poll_output handed the packet
out allows exactly one more resend: the server rejected the packet
(damaged on the line, sent while it was busy). The resend goes out
after Config::first_packet_nak_grace unless the server’s S (or
another answer) arrives first. A later NAK, a second NAK and a
timeout never allow it. Set it to the time the packet takes on the
wire plus slack: an idle server’s periodic NAK is byte-identical to a
rejection, and one that crosses the packet inside the window (the
server did take it) makes the command run twice if its answer takes
longer than the grace.
first_packet_nak_grace: Option<Duration>Wait after a NAK inside Config::first_packet_nak_window before
the one resend it allows; None (default) means
Config::nak_grace. Capped by the receive timeout. Further NAKs
while the granted resend waits do not shorten it.
first_packet_nak_byte_time: Option<Duration>Lower bound of Config::first_packet_nak_window: the time one byte
takes on the link (10 bits / baud, ~1.04 ms at 9600 baud). A NAK that
arrives sooner after the packet was handed out than the packet’s
length times this cannot be the server’s answer to it (the packet
had not finished arriving): it is stale (input that was waiting, or
the idle server’s NAK sent while ours was on the wire). None
(default): no lower bound.
packet_pause: DurationDelay before each packet we send in reply to input (default 0).
nak_grace: DurationHow long a NAK received while waiting for the reply to the first packet is tolerated before we resend (default 1 s); such a NAK is usually a stale one from the idle server.
linger: DurationAfter we ACK the final B packet of a receive, keep answering a
retransmitted B with the same ACK for this long (default 1 s), in
case our ACK was damaged or lost. Done is emitted when the ACK is
queued; the linger emits nothing. Client::is_idle is false while
it lasts; Client::start ends it early. Duration::ZERO turns it
off. A peer that only retransmits after its own timeout (the TIME
we send, Config::timeout) is caught only by a linger that long.
max_size: Option<usize>Receive: most decoded data bytes accepted in one transaction (all
files and server text together); more fails the transaction with
Error::TooLarge and an E packet. Default 4 MiB, well above the
largest HP object; None means no limit.