-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onConnect callback required for renewing subscriptions #52
Comments
Yes OK I'll update the client to add one. As a thought, the client maintains a list of subscriptions, would an option to automatically re-subscribe to these on re-connection be useful? |
On that note, how is reconnection supposed to work? If there is an error during the initial connect, I can't see that a reconnection attempt will be made. |
The client automatically tries to reconnect if the initial connection attempt fails, at the moment this is hard wired to 3 attempts in total, you can see this if you edit the mqtt_client.dart in the examples folder to connect to a non-existent broker and turn logging on |
I solved this issue for now by using a 5 second one shot timer to call _connect when the timer expires in the _onDisconnect void _onDisconnected() { void _reconnect() { |
OnConnect callback added, client re-published at 5.0.0. |
onConnect callback feature is required when the client gets disconnected when there is network loss. This callback can be used to renew subscriptions.
The text was updated successfully, but these errors were encountered: