-
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
When unsubscribing, client disconnects with an "OnDisconnected callback is unsolicited or none" message #451
Comments
Yes you are correct, both methods should work, the problem is in the unsubscribe message -
We adjust the unsubscribe message header if the protocol is V311, however this checks Protocol, it should check the variable header -
Also this comment is incorrect -
I'll fix this as well, thanks for reporting this. |
Sorry forget the above fix, the version setting is on the connect message not the unsubscribe message, we should get the connect message to update the Protocol also -
|
Thanks for the feedback Steve. |
Do you want a PR raised for the fix? |
No thanks, I've already raised one and incorporated the fix, see #452. I'll close this issue when I release the package at the next version with this in it. |
Incorporated into version 9.8.1 |
After doing a bit of research, I found several issues that mention this problem suggesting that a call to
.setProtocolV311()
resolves the disconnect. The good news is that the suggested fix works. The bad news is that it appears inconsistent with creating anMqttConnectMessage()
to override certain behaviour and setting the protocol/protocol version in the connectMessage.This means that this code doesn't work as expected,
Whereas, this code does:
Further digging indicates that the former example calls this code:
While the latter calls this:
Is there a reason for the difference? From the documentation I really would have expected them to do the same thing.
The text was updated successfully, but these errors were encountered: