Close connection at the end of finally-block
The async processors use the socket file descriptors from the connection. Therefore, the connection must not be closed before all async processor threads are joined. PR #3978 <https://github.com/Genymobile/scrcpy/pull/3978>
This commit is contained in:
parent
92483fe11b
commit
9c08eb79cb
1 changed files with 4 additions and 1 deletions
|
@ -92,7 +92,8 @@ public final class Server {
|
|||
|
||||
List<AsyncProcessor> asyncProcessors = new ArrayList<>();
|
||||
|
||||
try (DesktopConnection connection = DesktopConnection.open(scid, tunnelForward, audio, control, sendDummyByte)) {
|
||||
DesktopConnection connection = DesktopConnection.open(scid, tunnelForward, audio, control, sendDummyByte);
|
||||
try {
|
||||
if (options.getSendDeviceMeta()) {
|
||||
connection.sendDeviceMeta(Device.getDeviceName());
|
||||
}
|
||||
|
@ -150,6 +151,8 @@ public final class Server {
|
|||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue