I am developing a instant chat app on Android using smack API. I set the KeepAliveInterval to 2 seconds using the following code:
However, I checked the log and found that KeepAliveInterval was not sent out until nearly 20 seconds after I logged in. I used Openfire as server and set the idle disconnection threshold to 15 seconds. So my client was disconnected before the first keep alive packet was sent out.
The app I am developing requires real-time monitoring of user presence, so I cannot reduce the idle disconnection threshold, the only option for me is to set the KeepAliveInterval to a small value.
Can anyone help me with this? Thanks.