Enum hiirc::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

Don't try to reconnect after failure.

Reconnect

Fields of Reconnect

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

A value of 0 means infinite 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.

Wait time after disconnection, before trying to reconnect.

Trait Implementations

impl Copy for ReconnectionSettings
[src]

impl Clone for ReconnectionSettings
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for ReconnectionSettings
[src]

impl PartialEq<ReconnectionSettings> for ReconnectionSettings
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Debug for ReconnectionSettings
[src]

[src]

Formats the value using the given formatter.

impl Default for ReconnectionSettings
[src]

Default settings are provided for this enum.

They are:

max_attempts = 10

delay_between_attempts = 5 seconds

delay_after_disconnect = 60 seconds