pub struct AcceptBackoff { /* private fields */ }Expand description
Implementations§
Source§impl AcceptBackoff
impl AcceptBackoff
pub const fn new() -> Self
Sourcepub fn accepted(&mut self)
pub fn accepted(&mut self)
A connection was accepted: the listener works, so forget the history.
Only accept() itself feeds this counter, and on RTEMS that is not
where a loaded server actually fails. Measured under qemu at the
connection ceiling: accept() succeeds and the per-connection
thread spawn then fails with EAGAIN, 64 times in a row, without a
single accept() failure — because this call has already run by then.
So the backoff describes a broken listener, not a full server; the
refusal path announces the latter.
Sourcepub fn failed(&mut self) -> Duration
pub fn failed(&mut self) -> Duration
An accept() failed. Returns how long to wait before the next attempt.
There is no other outcome: the loop retries forever, as C does. The
caller does the waiting, because only it knows whether it is a thread
(thread::sleep) or a task (tokio::time::sleep).
Announces the failure on the way past — see the module docs on why an
errlog line at powers of two, and not the tracing event alone,
is what an RTEMS console can actually receive.
#[must_use]: dropping the delay is the original defect — a failure
that is not waited on is the hot spin.
Sourcepub fn consecutive_failures(&self) -> u32
pub fn consecutive_failures(&self) -> u32
Failures since the last success. Diagnostics and tests.
Trait Implementations§
Source§impl Clone for AcceptBackoff
impl Clone for AcceptBackoff
Source§fn clone(&self) -> AcceptBackoff
fn clone(&self) -> AcceptBackoff
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more