As far as I can see from the source, disconnect() will also not terminate the connection.
I first thought that simply changing JBOSH’s close() to call dispose with null would be the better approach. But then I read
Forcibly close this client session instance. The preferred mechanism
to close the connection is to send a disconnect message and wait for
organic termination.
So it appears there is an organic termination mechanism that is will happen once the session is disconnected. I assume that’s simply the BOSH HTTP connections running in a timeout and being recreated. Which means everything is ok as it is.
but BOSHClient.disconnect(ComposableBody) is already called by XMPPBOSHConnection.shutdown(), which is called by AbstractXMPPConnection.disconnect(). So what you did seems a bit redundant.
I swear when I looked at it that one day, XMPPBOSHConnection.shutdown() had a call to BOSHClient.disconnect(). But now I can’t find it anymore. Maybe an effect of the sleep deprivation I experience.
Anyway, thanks for commit back.
So why not simply add
try {
client.disconnect()
} catch (BOSHException e) {
LOG.log(Level.warning, “Exception while disconnecting bosh client”, e)
}
to XMPPBOSHConnection.shutdown()
assuming that this will organically terminate the HTTP/TCP connections too (after some time).