|
|
|
@ -63,7 +63,7 @@ public final class Server {
|
|
|
|
final Device device = new Device(options);
|
|
|
|
final Device device = new Device(options);
|
|
|
|
List<CodecOption> codecOptions = CodecOption.parse(options.getCodecOptions());
|
|
|
|
List<CodecOption> codecOptions = CodecOption.parse(options.getCodecOptions());
|
|
|
|
|
|
|
|
|
|
|
|
initAndCleanUp(options);
|
|
|
|
Thread initThread = startInitThread(options);
|
|
|
|
|
|
|
|
|
|
|
|
boolean tunnelForward = options.isTunnelForward();
|
|
|
|
boolean tunnelForward = options.isTunnelForward();
|
|
|
|
|
|
|
|
|
|
|
|
@ -95,6 +95,7 @@ public final class Server {
|
|
|
|
// this is expected on close
|
|
|
|
// this is expected on close
|
|
|
|
Ln.d("Screen streaming stopped");
|
|
|
|
Ln.d("Screen streaming stopped");
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
initThread.interrupt();
|
|
|
|
if (controllerThread != null) {
|
|
|
|
if (controllerThread != null) {
|
|
|
|
controllerThread.interrupt();
|
|
|
|
controllerThread.interrupt();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -105,6 +106,17 @@ public final class Server {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Thread startInitThread(final Options options) {
|
|
|
|
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
initAndCleanUp(options);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
thread.start();
|
|
|
|
|
|
|
|
return thread;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static Thread startController(final Controller controller) {
|
|
|
|
private static Thread startController(final Controller controller) {
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|