You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, I agree this is confusing. I simply exposed the behavior of the underlying C library, and I'm not particularly happy about having to specify the version twice, either.
I think the C lib wants to know if you might use a v5 connection when you create the client so it can create some persistence information differently. But it obviously still lets you create a v3 connection... which you found out by accident :-)
We could take the hint from the create option to be the default when connecting. That would certainly be better than the way it works now.
But even better than that maybe either:
Default to a v5 create option and then let the connect option decide the requested version.
or, remove the create option entirely from the API, always create a v5 client in the C lib, and let the rust app chose the version for each connection.
So, either way, chose the version in the connect options, but decide whether or not to even keep the option when creating the client.
OK. The connection will default to the version of MQTT specified in the client's create options. Basically, now you can chose to connect with an older version of the protocol than the one specified when creating the client, but you can not connect with a newer one...
Meaning:
If you create the client as v5:
The connection will default to v5 if none is specified in the connect options
You can still connect with v3 by specifying it in the connect options
If you create the client as v3.x:
You can only connect with v3
You do not need to specify it in the connect options
In my first approach of using the paho mqtt crate I added my settings to
CreateOptions
likeby using
cli.connect(None)
I expect to use the settings of CreateOptions but at least themqtt_version
is ignored and mqtt_version 0 is used.The text was updated successfully, but these errors were encountered: