SIGN IN SIGN UP

Kill the server only after a small delay

Let the server terminate properly once all the sockets are closed.

If it does not terminate (this can happen if the device is asleep), then
kill it.

Note: since the server process termination is detected by a flag set
after waitpid() returns, there is a small chance that the process
terminates (and the PID assigned to a new process) before the flag is
set but before the kill() call. This race condition already existed
before this commit.

Fixes #1992 <https://github.com/Genymobile/scrcpy/issues/1992>
R
Romain Vimont committed
10b749e27d34f91d04ff165134fda23e6ec2cc3b
Parent: 05e8c1a