Closed aarjan closed 6 months ago
The client is event driven, if it is connected it will stay connected until an event from the Dart/IOS runtime is received that changes this, e.g. a disconnection event. If no event is received then the client will think it is still connected. The log out put should tell you what is happening when your wifi is turned off.
@shamblett my concern is that it works out of the box in Android, i.e. connectionState is in not-connected state in Android automatically when wifi/internet is off. But, it still shows connected in iOS.
Also,
In answer to your questions -
2023-10-20 15:03:30.596972 -- MqttSynchronousServerConnectionHandler::internalConnect - calling connectAuto flutter: 2023-10-20 15:03:30.597039 -- MqttNormalConnection::connectAuto - entered flutter: 2023-10-20 15:03:30.612171 -- MqttSynchronousServerConnectionHandler::internalConnect exception thrown during auto reconnect - ignoring flutter: 2023-10-20 15:03:30.612348 -- MqttSynchronousServerConnectionHandler::internalConnect - connection complete
If the client works as expected on Android but not on IOS then you need to look at IOS, the client doesn't know where its running, it just sits on top of the Dart/flutter runtime. You could compare logs between the two and see what IOS is not doing.
I'm sure other IOS users have seen this(look through the closed issues) and solved it by picking up some kind of IOS system event issued when you turn off wifi and wired this into the disconnect method.
While i turn the WIFI off, the connectionState still shows connected.