Skip to main content

IDLE_TIMEOUT

Constant IDLE_TIMEOUT 

Source
pub const IDLE_TIMEOUT: Duration;
Expand description

How long the initial exchange goes without progress before it gives up on the peer.

Progress is a frame read from the peer or a frame written to it, and both directions count: a side sending a 1 GiB file hears nothing from the peer for as long as that takes, and must not give up on it for that. A bound on silence rather than on total time is what lets one large file take minutes while a peer that has stopped altogether is still let go of.

Progress counts whole frames, so a peer draining slower than about one CHUNK per IDLE_TIMEOUT (some 4 KiB/s) is given up on even though bytes are still moving.

The Hello wait has its own bound, HELLO_TIMEOUT, and the live phase after the exchange has none.