powered by Jive Software

Openfire don't realize idle sessions

My web application uses conversejs library for chat client and Openfire 4.0.0 xmpp server. When the user login the system, I create new xmpp bosh session and return request id, session id and jabber name for prebind. If the user close active browser tab, the bosh session stay online and openfire not closed this session. I researched and changed all openfire settings about idle connection, but not working. Exp. I changed “xmpp.client.idle”, “xmpp.httpbind.client.idle”(Default 30 seconds) property but not working. When I set xmpp.client.idle to 10000 miliseconds , openfire sends ping every 3 minutes. I think that the ping default value (360 seconds) is not override. I want to openfire detects online session as idle and close about 2 seconds automatically. What is default time for client should anwered to openfire idle ping and how to set this property ? When I look at latest openfire documentation, protocol support part is not include XEP-0199 ping.

1 Like

openfire 4.0.0

I’m also having the same problem in the previous version had no problem, had set to 30 seconds and it worked perfectly, now I set for 30 and appears on the console 300, be a mistake?

I was wondering if there is any way to fix this, because I need that customers turn off after closing the browser tab.

any idea how to solve?

When I set xmpp.client.idle to 10000 miliseconds , openfire sends ping every 3 minutes. I think that the ping default value (360 seconds) is not override.

I have just tested this on Openfire 4.0.1 with Spark 2.7.5. I have Spark running in a virtual machine. Idle settings set to 10000 (10 seconds). Then i pause the machine. Spark gets disconnected after 10 seconds. Then i set idle setting to 30000 and restart the server. Pause the machine with Spark. It gets disconnected after 30 seconds. So it seems it is working correctly. At least with Spark. Setting is saving correctly.

TugaFire wrote:

had set to 30 seconds and it worked perfectly, now I set for 30 and appears on the console 300, be a mistake?

Have tried to set xmpp.httpbind.client.idle to 30000 and it saved correctly (not as 300000).

I have enterprise web application and I use 7070 port for http-bind. I use console for ping request and response.Openfire may works ping system only for 5222 port exp. spark application. I set properly xmpp.httpbind.client.idle for 2-3 secons as miliseconds, but I didn’t see ping request and reponse. I tried to solve this problem in my application using different xmpp server and I can see ping but I must use openfire server. You must apply my problem with converse.js and openfire. Firstly you must download converse.js and example index.html is changed with bosh_service_url: ‘https://your-host:7070/http-bind/’, in converse initialize method. You can see all xhr packets with browser tools.

Admin Console shows that 7443 port is used for SSL connections. Have you changed that to 7070 for SSL?

I changed http-bind to 7443, but the user can not login. I will research for SSL for conversejs.


I’m using version 4.0.0 do not know if it will be a mistake, I am using http-bind secure connection 7443.

configured (xmpp.client.idle

  1. and (xmpp.httpbind.client.idle

  2. for 10 seconds, I restarted the server and returned to test the server does not work should be 10000 10 seconds, and disconnects only after 1 minute and 30 seconds margin.

am I doing something wrong?

no my friend…

https no http…

port http = 7070

port https = 7443 ssl secure.

you can only use the secure port 7443 if you have the certificate to work properly, best to use only http: // server: 7070 / http-bind

You are right, I have changed to bosh service url with secure but I can not login.

to use these certificates checked?

INSERT enters the browser and https: // server: 7443 / http-bind /

is working?

I can’t test with HTTP-Bind. Don’t have a web client. But the normal client setting appears to be working correctly.

Mustafa > you should change it back to 7070. In your reply you gave a link containing https, so i thought you were using SSL. But it appears you are not. So revert back to 7070.

Anyway, i have filed this as [OF-1076] Openfire not sending ping to BOSH clients - Jive Software Open Source for someone to take a look

1 Like

I installed ssl certificate from web browser and imported this certificate to trusted root certification authorities in windows. I connected with 7443 port for secured HTTP client connection but ping problem continues tragically.

Anybody on this thread still seeing this with Openfire 4.0.4 or the 4.1 Beta?

For the issue “[OF-1076] Openfire not sending ping to BOSH clients” seems to be valid.

Digging into openfire code inside file XmppWebSocket.java
Below method takes very long time(15 -20 minutes ) for Web Socket to be detected as closed.

public void onClose(int statusCode, String reason) {


Also This class has PingTask scheduled every 60 seconds to send PING with an expectation of PONG from remote end.

Seems likes org.eclipse.jetty.websocket.api is not working as expected and is taking very long time.

wsSession.getRemote().sendPing(null); <- this is not throwing IOException or not triggering @OnWebSocketClose Annotation.

It seems like some commits recently went in that will be available for Openfire 4.3.0 to address this issue.

I installed the nightly build rpm [ openfire_2018-10-12-noarch.rpm ] - ‘Openfire 4.3.0 Alpha’ and tested with websocket client .

steps involved:

1.) use the xmpp websocket client and make it online on the device through the wifi connection.
2.) turn off the wifi on the device.

The client session inside openfire should be cleaned up in like (60 seconds ) and mark it as offline.

client session cleans up only after 15 minutes.

seems like the issue is not resolved.
The websocket session closes only after 15 minutes.

Also, is the below issue fixed with this nightly build ?
[OF-1596] - Websocket sessions are not cleaned up properly.

would you please help me with the fixes related to bug#OF-1076 and bug#OF-1596?
where is it fixed inside the source code of openfire?


Do you have Openfire properties set that may be governing when Openfire thinks connections are Idle?

Hello Daryl,

I think this issue is related to jetty (websocket).
The behavior happens because jetty is not designed to track TCP re-transmission while sending PING with op-code

please have a look in below stackoverflow link:

Now the real question here is that “how the data Write timeout can be detected?” using JETTY

because if we can able to detect the timeout for data sent from server over TCP and is not received at remote client, then this problem can be resolved!

Also i learned that, openfire uses two set of libraries.
1.) Apache MINA (NIOConnection.java) - for NON websocket clients.
2.) Jetty (XmppWebSocket.java) -for WebSocket clients.

But surprisingly,
The PING/PONG logic with NIO connection (using apache MINA) works in openfire.
and with JETTY it is not working !

1 Like