From 0ad856bed164a3cb584f2f195fd323e2c3d25875 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 9 Aug 2016 15:46:08 +0200 Subject: [PATCH] detect socket closed error --- .../androidaps/plugins/DanaR/Services/ExecutionService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java index 2a1051565d..41d2570e98 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java @@ -203,7 +203,11 @@ public class ExecutionService extends Service { try { mRfcommSocket.connect(); } catch (IOException e) { - e.printStackTrace(); + //e.printStackTrace(); + if (e.getMessage().contains("socket closed")) { + e.printStackTrace(); + break; + } } waitMsec(1000);