-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Automatic Reconnect Ability (#184)
- Loading branch information
1 parent
f51e332
commit 332109b
Showing
17 changed files
with
2,252 additions
and
2,338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Automatic Reconnect | ||
|
||
The HiveMQtt MQTT library provides an automatic reconnect functionality that allows the client to automatically reconnect to the MQTT broker in case of a disconnection. This feature is disabled by default. | ||
|
||
# Example | ||
|
||
```csharp | ||
var options = new HiveMQClientOptionsBuilder() | ||
.WithAutomaticReconnect(true) | ||
.Build(); | ||
|
||
// Create a new client with the configured options | ||
var client = new HiveMQttClient(options); | ||
``` | ||
|
||
# Backoff Strategy | ||
|
||
The automatic reconnect functionality uses a backoff strategy to attempt to reconnect to the MQTT broker periodically until success. The backoff strategy starts with a delay of 5 seconds and doubles the delay with each failed attempt, up to a maximum of 1 minute. | ||
|
||
# Maximum Attempts | ||
|
||
The backoff strategy will attempt to reconnect a maximum of once per minute. The client will attempt to reconnect indefinitely until successful. | ||
|
||
# Summary | ||
|
||
The automatic reconnect functionality a convenient way to handle disconnections from the MQTT broker. Users can also use the `OnConnect` event handler to add custom logic when the client successfully reconnects to the MQTT broker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.