I am using smack client in my chat application. Everything is going to be fine but when connection aborted for some reason, my server is showing online for that user JID.
My problem is that how to reconnect to the server again after disconnecting. I am able to catch for connection using connection.isAuthenticated() method in my service thread. But unable to reconnect to the server.
you can enable mod_ping module on server side (ejabberd) to overcome online issue if client disconnect but still show online. This is related to how TCP/IP works and is not specific to ejabberd. Generally, Linux is configured to detect connection loss after something like 2 hours and client side use ReconnectionManager to reconnecting app to ejabberd server or you can define your own handler to track active connection if not connected to server you can connect it again.How to enable mod_ping check here - https://docs.ejabberd.im/admin/configuration/#modping