Or sometimes it just stops after disconnection with MOSQ_ERRNO.
Then I set mqttReconnOpts=nil and call reconnect() in onDisConnectCallback,
but connection is never made after Disconnect_Requested, so I changed it to disconnect() and reconnect(), this is power consumptive so I changed it to trigger disconnect()/reconnect() with a watchdog timer instead of in onDisConnectCallback. This works in most of time but once or twice a day, I get infinite Disconnect_Requested.
Finally, renew MQTTClient instance in onDisConnectCallback and watchdog timer emulate reconnection, but the session is of course lost.
Autoreconnect stops when I
Or sometimes it just stops after disconnection with MOSQ_ERRNO.
Then I set mqttReconnOpts=nil and call reconnect() in onDisConnectCallback, but connection is never made after Disconnect_Requested, so I changed it to disconnect() and reconnect(), this is power consumptive so I changed it to trigger disconnect()/reconnect() with a watchdog timer instead of in onDisConnectCallback. This works in most of time but once or twice a day, I get infinite Disconnect_Requested.
Finally, renew MQTTClient instance in onDisConnectCallback and watchdog timer emulate reconnection, but the session is of course lost.
I'm using pod 'Moscapsule', :git => 'https://github.com/flightonary/Moscapsule.git' pod 'OpenSSL-Universal', '~> 1.0.1.18' on iOS 10.
Any suggestion?