Is there a keepalive which is implemented by openfire?

I’‘ve built up two flash clients with different libraries and each one gets disconnected after a few minutes. I’'ve checked the server settings and my MUC server is set to never kick clients. Why am I losing my connection?

-Walt

Hey Walt,

Openfire will kick idle client sessions after an amount of time defined by the “xmpp.client.idle” property. This cleans up sessions from clients that have disconnected unexpectedly. If the property is not set, some default setting is used, but I don’'t remember that value from the top of my head.

Idle clients (that should remain online) usually send out ‘‘white space pings’’ to let the server know that they are still alive. A client can ping the Openfire server by sending a space character every few seconds (or minutes). The server won’'t kick a client that sends out these pings regularly (within the idle timeout value, of course).

By the description that you give, I think one of your libraries does send out these pings, while the other doesn’‘t. That’'s why one connection is being dropped, while the other one remains online.

Hope this helps!

Guus,

That did the trick. I’'m not getting dropped any longer. Many thanks!

Hi,

Is there a XMPP stanza that can serve as a ping packet? I was thinking about an empty packet, but found out this would cause the XMPP server to respond with presences of people on the current user’s roster.

Thanks,

Richard

Richard,

You can send a whitespace to the server, which wil suffice.

With Openfire 3.6.0, you can also send a XEP Ping to the server, but I haven’t tried this yet to see if it works.

daryl

Thanks Daryl for your response.

Since I’m using xmpp4js to write my web chat client, I don’t see a xmpp4js API to send just a whitespace to server. Therefore I was asking for a particular packet to serve as a ping. Currently, I’m sending an empty as the ping packet which seems to do the job fine. I’m also aware of the XEP-0199 PING spec, but again xmpp4js doesn’t support it yet.

Richard