Connection timeout problem

Hello all,

I’m able to connect to the server using XMPPConnectin, but the problem I have is, i’m loosing the connection very fast, ie,. within 5 mins if the user is idle. Is there a way to increase the timeout duration?

Hi Sai,

Not sure what library you’re using but there is the concept of an XMPP ‘ping’ (keepalive). The XIFF libraries already have the code built in and I’d imagine the Java libraries do too, simply send one of those keepalive packets on a timer and your connection should stay open.

Check out for mor einfo.

I’m using XIFF library, sorry for not mentioning. But I do not see it in the XMPPConnection class.

Are we talking about sendKeepAlive()?

That’s the one, that will send an XMPP ping to the server and should stop your account from timing out.

How much time should I keep for the timer? I’m able to get it to work for 10 mins, later somehow the connection is timed out.