Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XMPP iOS Framework detect internet disconnection issue with OpenFire server

I have implemented chatting application using XMPP iOS Framework with OpenFire server.

Fortunately, application is running successfully but I am facing one issue of internet disconnection in application.

When user is getting logout or went in offline mode manually then it sends stanza to his/her rosters. So his/her rosters knows that user went in offline mode.

Now when internet will disconnect from user's device at that time application is not able to send presence stanza to server due to internet disconnection. So his/her rosters won't get information about that offline user and user will be shown in online mode only.

I thought something like OpenFire server might be able to check connected users and whenever any user gets disconnected it should send presence stanza with offline status to his rosters so they can know that this user is on offline mode.

Can anybody please help me if there is any way through which I can implement this feature.

It will be very helpful for me to solve this issue.

Thanks in advance.

like image 449
Jayeshkumar Sojitra Avatar asked May 13 '15 07:05

Jayeshkumar Sojitra


1 Answers

It's the core xmpp feature and Openfire must send unavailable to your contacts on your behalf. So it looks like a bug. But there is a different problem - users with mobile internet may reconnect too often, and XMPP community developed a Stream Management extension, which allow server to "hibernate" client session when it quickly reconnect and restore it without presence changes. Summarize:

  1. Check if Stream Management is active - in this case user will still online fixed amount of time (typically 5 minutes) and then go offline.
  2. Check if Openfire implements any non-standard extension to maintain user session.
  3. If you are sure none of extensions are "hibernating" user session - then it is a really bug. Try the same with different xmpp server - good candidates are ejabberd and prosody
like image 98
vitalyster Avatar answered Nov 19 '22 18:11

vitalyster