User is still Online although user is not connected to the server. And failed to reconnecting to the server

拟墨画扇 提交于 2019-12-12 01:22:32

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/42291862/user-is-still-online-although-user-is-not-connected-to-the-server-and-failed-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!