title: Jabber user going offline: Why the two different scenarios?
body: <p>I have an Android client working in tandem with ejabberd XMPP server.</p>
  
  <p>Observations:</p>
  
  <ul>
  <li><p><strong>Scenario 1:</strong> When I swipe-right the app (kill the app), the user goes offline on the server immediately. Its status is changed to offline at that very instant.</p></li>
  <li><p><strong>Scenario 2:</strong> However, when I simply shut-down the Wi-fi connectivity (data) of my Android Jabber client, there is a noticeable lag of a few minutes for the user to be marked offline on the server.</p></li>
  </ul>
  
  <p>I can’t figure out what is the fundamental difference in the two processes.</p>
  
  <p>What could be done in Scenario 2 to make it <strong>go offline immediately</strong>?</p>