ConnectionListener is not working properly

Hello Community,

I have a problem with reconnection and tracking connection status.

I’m using code like this:

connection.addConnectionListener(new ConnectionListener(){

ReconnectionManager reconnectionManager;

public void connectionClosed() {



public void connectionClosedOnError(Exception arg0) {



public void reconnectingIn(int arg0) {



public void reconnectionFailed(Exception arg0) {



public void reconnectionSuccessful() {




The problems:

  1. connectionClosedOnError() is called only after very long time after cable disconnect.

  2. All other methods are never called.


Is realy ConnectionClosedOnError() is called after cable disconnect.? In my case it’s not working, connectionClosed{} method happens when Connection is normally closed, can u suggest me for Web Application to handle abnormal close like brower close,power shutdown?

I’m not sure about the use of ReconnectionManager here. What happens if you put a System.out.println(“your message here”) in each method (and open the Java console)?

Disconnect of a cable does take a long time to timeout, unfortunately.

When i put System.out.println in connectionClosed() method, it shows in the console when connection is properly closed., but for Web Application we cannot sure clients logout properly , how gmail does in 8 seconds its wondering :(.

I posted the situation in this thread

If you find any answer please let me know…

Thanks in advance…