Autoreconnect stall
buganini opened this issue · 2 comments
Autoreconnect stops when I
- enable airplane mode
- onDisconnectCallback (KeepAlive_Timeout)
- onDisconnectCallback (Disconnect_Requested)
- disable airplane mode
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?
Did you try to use latest master branch version?
Yes, I am using latest master branch.