wss onNetworkDisconnected
czqinyes opened this issue · comments
Let's move on to #212, failure to connect to WSS is the MQTT version issue(mqttClient->setVersion(QMQTT::MQTTVersion::V3_1_1);).
But a new problem arose, connected, disconnect all the time, unsteadiness.
If possible, I will email the test domain to you for testing.
Please send me an email. Thank you very much
I don't understand what you mean here. Is using MQTT V3.1.1 causing issues? Are those issues different from using the default version? How often do these disconnects occur? Do you have normal communication when connected? If you have access to the mqtt broker, you could check out the server logs.
To get some more insight into the issue, maybe you can try to use your code with a public mqtt service. For example this one: https://www.emqx.io/mqtt/public-mqtt5-broker. I've tested the example project on this one using SSL and websockets. Note that on this server you cannot subscribe to all topics (topic filter '#'). The filter needs to start with a known topic segment. So 'blah/#' should work.
At last I found the cause of the problem is I have not setKeepAlive, the default is 300 seconds, when I set 30 seconds is ok.
Thanks.
I see. My program open once only.
The problem has been solved. It can be closed. Thank you
At last I found the cause of the problem is I have not setKeepAlive, the default is 300 seconds, when I set 30 seconds is ok.
Thanks.