I am using Smack for android to connect to openfire server.
I am using XMPPConnection.isConnected() to detect if the user is connected to the server or not
My issue is that isConnected() return true, although internet connection is broken. This behavior can be reproduced following these steps:
Turn on WiFi hotspot on a mobile device X.
Connect from mobile device Y to the hotspot.
Connect to openfire from Y: XMPPConnection.isConnected() return true
Disable mobile data from device X, without turning off the WiFi hotspot.
XMPPConnection.isConnected() still returns true, although there is no internet connection.
If you tried to send a message using XMPPConnection.sendPacket(), it will be lost and there is no error or exception given.
So Is there any alternative way to detect broken connection with openfire?