powered by Jive Software

Android Smack client suddenly sends Unavailable PRESENCE for no reason, then server thinks i'm offline

android

#1

I am using Smack version 4.2.3 for android
I am working with openfire 4.2.2 server.
In the server i have configured Client Connection - Idle Connections Policy - Disconnect client after 30 seconds + Send an XMPP ping request to idle clients.

In the client, I have set a stable XMPPConnection with a ReconnectionManager enabled, and a ConnectionListener that reports each connect/reconnect/disconnect event.

I am connected to the server with my client with username: john@test.com.
When I look at the packets with Wireshark going back and forth from the server to the client, I can see the ping requests and my ping results every 15 seconds and thus the server sees me as Online.
However, after about 10 minutes, suddenly I get a PRESENCE packet from the server of type Unavailable from john to john and then immediately the server sees me as Offline.
In my client I never deliberately send an Unavailable presence, except when I call connection.disconnect().
Also, in the client’s connectionListener I do not see any action when this happens, and the pings keep going back and forth even after this happens, yet the server still thinks I am offline.

Anybody have any idea why is this happening?

Thanks.


#2

I think this may cause problems, but I’m not an expert.


#3

Hi, We also facing same issue, any solutions you found for this problem.

Thanks
Mohsin


#4

Same here, as @fuxuhew said, this is happening since 4.2