mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Shutdown streaming when the input connection breaks
This commit is contained in:
parent
08f8942548
commit
4d80373f25
@ -67,6 +67,8 @@ public class NvConnection {
|
|||||||
|
|
||||||
public void stop()
|
public void stop()
|
||||||
{
|
{
|
||||||
|
threadPool.shutdownNow();
|
||||||
|
|
||||||
videoStream.abort();
|
videoStream.abort();
|
||||||
audioStream.abort();
|
audioStream.abort();
|
||||||
|
|
||||||
@ -111,9 +113,10 @@ public class NvConnection {
|
|||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
displayToast(e.getMessage());
|
displayToast(e.getMessage());
|
||||||
|
stop();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
displayToast(e.getMessage());
|
displayToast(e.getMessage());
|
||||||
|
stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
@ -130,8 +133,8 @@ public class NvConnection {
|
|||||||
try {
|
try {
|
||||||
inputStream.sendMouseMove(deltaX, deltaY);
|
inputStream.sendMouseMove(deltaX, deltaY);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
displayToast(e.getMessage());
|
displayToast(e.getMessage());
|
||||||
|
NvConnection.this.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -148,8 +151,8 @@ public class NvConnection {
|
|||||||
try {
|
try {
|
||||||
inputStream.sendMouseButtonDown();
|
inputStream.sendMouseButtonDown();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
displayToast(e.getMessage());
|
displayToast(e.getMessage());
|
||||||
|
NvConnection.this.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -166,8 +169,8 @@ public class NvConnection {
|
|||||||
try {
|
try {
|
||||||
inputStream.sendMouseButtonUp();
|
inputStream.sendMouseButtonUp();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
displayToast(e.getMessage());
|
displayToast(e.getMessage());
|
||||||
|
NvConnection.this.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -189,8 +192,8 @@ public class NvConnection {
|
|||||||
rightTrigger, leftStickX, leftStickY,
|
rightTrigger, leftStickX, leftStickY,
|
||||||
rightStickX, rightStickY);
|
rightStickX, rightStickY);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
displayToast(e.getMessage());
|
displayToast(e.getMessage());
|
||||||
|
NvConnection.this.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user