pub struct AddressHistory { /* private fields */ }Expand description
What attempts on a server’s addresses came to, for the order of later attempts (RFC 8305 section 4): “If the client is stateful and has a history of expected round-trip times (RTTs) for the routes to access each address, it SHOULD add a Destination Address Selection rule between rules 8 and 9 that prefers addresses with lower RTTs. If the client keeps track of which addresses it used in the past, it SHOULD add another Destination Address Selection rule between the RTT rule and rule 9, which prefers used addresses over unused ones.” An address whose last attempt failed goes last (RFC 6724 rule 1).
“This historical data MUST NOT be used across different network interfaces and SHOULD be
flushed whenever a device changes the network to which it is attached.” Every outcome is
kept under the local address it was had from (the interface), and read back only for that
local address; interface flushes the history when a local address not
seen before appears once any is known.
Implementations§
Source§impl AddressHistory
impl AddressHistory
Sourcepub fn succeeded(&mut self, local: IpAddr, remote: SocketAddr, rtt: Duration)
pub fn succeeded(&mut self, local: IpAddr, remote: SocketAddr, rtt: Duration)
An attempt from local to remote was answered, rtt after it started.
Sourcepub fn failed(&mut self, local: IpAddr, remote: SocketAddr)
pub fn failed(&mut self, local: IpAddr, remote: SocketAddr)
An attempt from local to remote failed (went unanswered, or its connection or
handshake failed). What the address took when it last answered is kept.
Sourcepub fn rank(&self, local: IpAddr, remote: SocketAddr) -> AddressRank
pub fn rank(&self, local: IpAddr, remote: SocketAddr) -> AddressRank
The rank of remote for attempts from local (nothing known: the default).