As per the code Smack/XMPPBOSHConnection.java at master · igniterealtime/Smack · GitHub
at line number 290 there should be a client closing code
but the client close code only exists in the connect() function and no where else it is called
this leads the client to stay connected until the main thread terminates
Introduce a private function saying close()
and put
---------------------------
if (client != null) {
client.close();
client = null;
}
---------------------------
and call it at both connect() as well as shutdown() functions