Jabber user goes offline: why two different scenarios?

I have an Android client working in tandem with the ejabberd XMPP server.

remarks:

  • Scenario 1: . If the application is connected correctly (kill the application), the user immediately disconnects on the server. At the moment, his status is disabled offline.

  • Scenario 2: However, when I just disconnect the Wi-Fi connection (data) of my Android Jabber client, there is a noticeable lag of several minutes for the user to mark offline on the server.

I cannot understand what is the fundamental difference in the two processes.

What can be done in scenario 2 to make it immediately offline offline ?

+4
source share
1 answer

Scenario 1: . When I scroll the application to the right of the application (kill the application), the user immediately disconnects on the server. At the moment, his status is disabled offline.

Android xmpp Android, , XMPP Android , , , XMPP (TCP-) XMPP, onDestroy(), , XMPP. , , , XMPP ().

2: , Wi-Fi- () Android Jabber, , .

, Android XMPP , Wi-Fi XMPP (TCP socke) , XMPP [ ] , , / XMPP . , - (.. ] . , .

2, ?

XMPP

XMPP, ping, ping , (, ), , ping inter [, ping] small .

, ejabberd XMPP, , ,

?

, . mod_ping. ping- , . . , .

+1

Source: https://habr.com/ru/post/1588978/


All Articles