pub struct RefreshTimer<T: Timebase> { /* private fields */ }Expand description
Encapsulating the SSDP retransmit process
The idea is, every 15 minutes or so, send a few repeated salvos of notification messages. The interval between salvos is randomised to help avoid network congestion.
Implementations§
Source§impl<T: Timebase> RefreshTimer<T>
impl<T: Timebase> RefreshTimer<T>
Sourcepub fn new(random_seed: u32, now: T::Instant) -> Self
pub fn new(random_seed: u32, now: T::Instant) -> Self
Create a new RefreshTimer
Sourcepub fn reset(&mut self, now: T::Instant)
pub fn reset(&mut self, now: T::Instant)
Reset the refresh timer (e.g. if network has gone away and come back)
Sourcepub fn next_refresh(&self) -> T::Instant
pub fn next_refresh(&self) -> T::Instant
Obtain the desired delay before the next refresh is needed
Sourcepub fn update_refresh(&mut self, now: T::Instant)
pub fn update_refresh(&mut self, now: T::Instant)
Update the refresh timer
The desired timeout duration can be obtained from
RefreshTimer::next_refresh.
Auto Trait Implementations§
impl<T> Freeze for RefreshTimer<T>
impl<T> RefUnwindSafe for RefreshTimer<T>
impl<T> Send for RefreshTimer<T>
impl<T> Sync for RefreshTimer<T>
impl<T> Unpin for RefreshTimer<T>
impl<T> UnwindSafe for RefreshTimer<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more