From: Nathaniel Wesley Filardo Date: Tue, 19 Feb 2019 01:18:40 +0000 (+0000) Subject: Try harder to tear down old mqtt connections X-Git-Tag: release-1.3~11 X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=bb1484868c1a16ac6ec09c2813ed2e7cc33d8a95;p=acmetensortoys-ctfws-android Try harder to tear down old mqtt connections --- diff --git a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java index 073e4f5..1681eb7 100644 --- a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java +++ b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java @@ -219,9 +219,11 @@ public class MainService extends Service { // and the documentation for all of this is amazingly lacking. Burn it all down. try { mMqc.close(); + mMqc.disconnect(0); } catch (IllegalArgumentException iae) { - Log.d("Service", "domqtt disconn close exn"); - // *&@#&^*#@#&@#&@# + Log.d("Service", "domqtt disconn close iae", iae); + } catch (MqttException me) { + Log.d("Service", "domqtt disconn close mqtt", me); } mMqc.unregisterResources(); @@ -237,6 +239,7 @@ public class MainService extends Service { // holder's reference to the game state. if (mqttcb.mCtfwscbs != null) { mqttcb.mCtfwscbs.dispose(); + mqttcb.mCtfwscbs = null; } // If we're deliberately disconnecting, tell the service about it. Otherwise, we'll