Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 11593

Re: BOSH connection not closed while disconnect()

$
0
0

Yes I tried that also, it jbosh does not allow null which will again throw another exception

 

so what I did is I overrided the disconnect() from AbstractXMPPConnection and I call super.disconnect()

 

    @Override

    public void disconnect() {

    synchronized (client) {

    try {

        client.disconnect();

        } catch (BOSHException e) {

        }finally{

         super.disconnect();

       }

      }

    }

 

which will do the jbosh disconnect as well as the XMPP disconnect unfortunately 2 unavailable presence will be sent

 

And I swallow the Exception in shutdown... probably a semi standard workaround

try {

           if (client != null) {

                client.close();

           }

       } catch (Exception e) {

        // Ignore

        } finally {

        client = null;

  }


Viewing all articles
Browse latest Browse all 11593

Trending Articles