The Paho automatic reconnect capability is pretty useless. While it does automatically connect to the broker again after an unexpected disconnect, it does not subscribe to the topics again. Further, since the broker will send the will message when the client disconnects unexpectedly, we need to send our "online" availability message when we reconnect. To resolve both of these problems, the `MqttClient::run` method now takes care reconnecting manually. When it receives a disconnect notification, it explicitly calls `AsyncClient::reconnect`. Once that succeeds, it resubscribes to the command topics and publishes an "online" message. |
||
---|---|---|
src | ||
.gitattributes | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
rustfmt.toml |