| 94 | // Call after sleep. Reduces the number of lost probes needed to classify as dead until a probe succeeded. Returns a packet for sending. |
| 95 | #[must_use = "the returned packet needs to be sent"] |
| 96 | pub fn wake(&mut self) -> Vec<u8> { |
| 97 | tracing::info!(message_id = "OsZ6HBJO", "liveness checker wake called"); |
| 98 | // Reset state to force an "aggressive" liveness check when the user wakes the device. |
| 99 | // - Higher risk of broken connection after sleep. |
| 100 | // - Likely chance that something will use the network (we probably woke for a reason). |
| 101 | let now = WakeInstant::now(); |
| 102 | *self = Self::new(self.mtu, self.src_ip, self.dst_ip); |
| 103 | self.is_waking = true; |
| 104 | // Immediately test connection after wake. |
| 105 | self.send_ping(now) |
| 106 | } |
| 107 | |
| 108 | pub fn poll(&mut self) -> LivenessCheckerPoll { |
| 109 | let now = WakeInstant::now(); |