-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add tenacious strategy and use it as default #64
Add tenacious strategy and use it as default #64
Conversation
The transport-reconnect could throw, but that wasn't handled correctly.
The simple client is thus significantly more robust to connection issues.
…ror_handling.permanent_client
…hub.com:toitware/mqtt into floitsch/better_error_handling.permanent_client
…ror_handling.permanent_client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
src/full_client.toit
Outdated
@@ -248,7 248,8 @@ abstract class DefaultReconnectionStrategyBase implements ReconnectionStrategy: | |||
] | |||
|
|||
receive_connect_timeout_ /Duration | |||
attempt_delays_ /List | |||
attempt_delays_ /List? | |||
delay_lambda_/Lambda? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delay_lambda_/Lambda? | |
delay_lambda_ /Lambda? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
src/full_client.toit
Outdated
if attempt_counter == 0: | ||
// In the first iteration we try to connect without delay. | ||
if not reuse_connection: | ||
logger_.debug "Attempting to reconnect" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this already what you consider a reconnect (not just a connect)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to "(re)connect".
src/full_client.toit
Outdated
hasn't received yet. | ||
Theoretically, this is a protocol violation, but most brokers just drop the packet. | ||
|
||
Note that this can also happen to clients that don't set the clien-session flag, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this can also happen to clients that don't set the clien-session flag, but | |
Note that this can also happen to clients that don't set the client-session flag, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
src/full_client.toit
Outdated
|
||
Note that this can also happen to clients that don't set the clien-session flag, but | ||
where the broker lost the session. This can happen because the session expired, the | ||
broker crashed, or a client with the same ID connectend in the meantime with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broker crashed, or a client with the same ID connectend in the meantime with a | |
broker crashed, or a client with the same ID connected in the meantime with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
The simple client is thus significantly more robust to connection issues.