powered by Jive Software

Connection timeout

HI

I am working on a simple chat client in flex with the help of openfire. To make connection i am using socket and with the help of handlers it gives me connection success , error, close , etc results.

My problem is after conncetion succes if i am not using the connection (means not sending any query or anything else ) it automatically fires connection close handler(after 3 minute). As i have not used any time out or anything like this why it fires i can’t understand.

Please help me .

Thanks,

Gunjan

Hi Gunjan,

this sounds a lot like a TCP or socket timeout, sending keep alive packets every minute should keep you connected.

LG

Thanks for reply Lg,

Can we set the tcp or socket timeout (as 10 min or 20 min ) at this time i have not set any timeout in my code.

gunjan

You can manipulate this timeout by setting (or adjusting) this property in Openfire: xmpp.client.idle You should set it to the amount of milliseconds that you want to allow your clients to be idle without being kicked.

Note that this value is intended to ‘clean up’ the clients that have disconnected, but not logged out (due to network failure, for example). If you set this value to 30 minutes, you might notice ‘ghost’ connections.

A nicer solution would be to keep this setting relatively low, and modify your clients in such a way that they send a whitespace character every minute.