Closed amrx101 closed 3 years ago
From the docs you can see Client.publish (and other methods) returns a crate::Result with the error part crate::Error which includes a Disconnected variant.
You'll need to check if publish (or any other methods your use) return this result and handle the errors appropriately. Likely you can just try reconnecting for any kind of error assuming the very first connect worked ok. There may be some StdError variants that are actually fatal OS issues but what you do with those I couldn't say.
Closing due to inactivity, I think @cs2dsb gave a sufficient response.
I have a use case where in
The first one, we can use a loop, but on the second , how do we handle reconnect with a loop. What kind of error does the
client
throw if disconnection happens.