Enum loirc::ReconnectionSettings [] [src]

pub enum ReconnectionSettings {
    DoNotReconnect,
    Reconnect {
        max_attempts: u32,
        delay_between_attempts: Duration,
        delay_after_disconnect: Duration,
    },
}

These settings tell the reconnection process how to behave.

Default is implemented for this type, with fairly sensible settings. See the Default trait implementation.

Variants

DoNotReconnect

Don't try to reconnect after failure.

Reconnect

Reconnect

Fields

max_attempts

After trying this amount of times, it will stop trying.

A value of 0 means infinite attempts.

delay_between_attempts

Wait time between two attempts to reconnect in milliseconds.

Note that if the computer's network is still unavailable, the connect call might block for about a minute until it fails. Somtimes, it fails instantly because it cannot resolve the hostname. You should probably leave at least a second of delay, so that it doesn't loop really fast while getting hostname resolution errors. You can watch the stream of errors via the ReconnectionError event.

delay_after_disconnect

Wait time after disconnection, before trying to reconnect.

Trait Implementations

impl Default for ReconnectionSettings

Default settings are provided for this enum.

They are:

max_attempts = 10

delay_between_attempts = 5 seconds

delay_after_disconnect = 60 seconds

fn default() -> ReconnectionSettings

Derived Implementations

impl PartialEq for ReconnectionSettings

fn eq(&self, __arg_0: &ReconnectionSettings) -> bool

fn ne(&self, __arg_0: &ReconnectionSettings) -> bool

impl Eq for ReconnectionSettings

impl Debug for ReconnectionSettings

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for ReconnectionSettings

fn clone(&self) -> ReconnectionSettings

1.0.0fn clone_from(&mut self, source: &Self)

impl Copy for ReconnectionSettings