MQTTnet icon indicating copy to clipboard operation
MQTTnet copied to clipboard

how to close auto reconnect function in MQTTnet3.0.11?

Open liaoliaoda opened this issue 4 years ago • 5 comments

hi,

I want to close auto reconnect function in MQTTnet3.0.11, but the default reconnect time is 5 seconds. So how can I close this function?

liaoliaoda avatar Sep 08 '20 07:09 liaoliaoda

You mean you warnt to disable that Feature?

chkr1011 avatar Sep 08 '20 09:09 chkr1011

You mean you warnt to disable that Feature?

Hi @chkr1011 ,

yes, I want to realize reconnect function by myself in the callback function of OnMqttClientDisconnected.

liaoliaoda avatar Sep 08 '20 09:09 liaoliaoda

I added this in master branch. Please let me know if this works for you.

chkr1011 avatar Sep 14 '20 21:09 chkr1011

I added this in master branch. Please let me know if this works for you.

hi @chkr1011 ,

ok, thanks a lot. I will try that and reply, but I would like to use the release version. So does this new option for disabling auto reconnect will be released in the next release version?

liaoliaoda avatar Sep 15 '20 01:09 liaoliaoda

Hi @chkr1011 ,

I setted WithoutAutoReconnect in MQTTnet3.0.13, but it failed when connect to server. Callback function did not work in OnMqttClientConnected OnMqttClientDisconnected and OnMqttClientConnectingFailed.

It blocked and did not has responded when the program started.

The program can connect to the server normally when remove WithoutAutoReconnect.

So could you pls help to look into this case. Thanks a lot.

liaoliaoda avatar Nov 03 '20 07:11 liaoliaoda

Please test with the latest version 4 and reopen this ticket if the issue still happens.

chkr1011 avatar Aug 14 '22 10:08 chkr1011