From 4d80373f250eca85cbd5068203fb3fce12179d3e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 11 Nov 2013 15:40:16 -0500 Subject: [PATCH] Shutdown streaming when the input connection breaks --- src/com/limelight/nvstream/NvConnection.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/com/limelight/nvstream/NvConnection.java b/src/com/limelight/nvstream/NvConnection.java index 6bfe4db1..5e54ff58 100644 --- a/src/com/limelight/nvstream/NvConnection.java +++ b/src/com/limelight/nvstream/NvConnection.java @@ -67,6 +67,8 @@ public class NvConnection { public void stop() { + threadPool.shutdownNow(); + videoStream.abort(); audioStream.abort(); @@ -111,9 +113,10 @@ public class NvConnection { } catch (XmlPullParserException e) { e.printStackTrace(); displayToast(e.getMessage()); + stop(); } catch (IOException e) { - e.printStackTrace(); displayToast(e.getMessage()); + stop(); } } }).start(); @@ -130,8 +133,8 @@ public class NvConnection { try { inputStream.sendMouseMove(deltaX, deltaY); } catch (IOException e) { - e.printStackTrace(); displayToast(e.getMessage()); + NvConnection.this.stop(); } } }); @@ -148,8 +151,8 @@ public class NvConnection { try { inputStream.sendMouseButtonDown(); } catch (IOException e) { - e.printStackTrace(); displayToast(e.getMessage()); + NvConnection.this.stop(); } } }); @@ -166,8 +169,8 @@ public class NvConnection { try { inputStream.sendMouseButtonUp(); } catch (IOException e) { - e.printStackTrace(); displayToast(e.getMessage()); + NvConnection.this.stop(); } } }); @@ -189,8 +192,8 @@ public class NvConnection { rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY); } catch (IOException e) { - e.printStackTrace(); displayToast(e.getMessage()); + NvConnection.this.stop(); } } });