From 7458d8271e89408c12b691f7440969771db11e31 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 9 Feb 2018 11:01:50 +0100 Subject: [PATCH] Kill the server immediately on close Do not wait 100ms anymore to let the server print any exception: we justly want to ignore them. Moreover, there is no nanosleep() on Windows, so this solve another problem. --- app/src/server.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/src/server.c b/app/src/server.c index bc5e4f9e..246083ab 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -4,7 +4,6 @@ #include #include #include -#include #include "netutil.h" #define SOCKET_NAME "scrcpy" @@ -123,13 +122,6 @@ void server_stop(struct server *server, const char *serial) { SDLNet_TCP_Close(server->device_socket); } - // let the server some time to print any exception trace before killing it - struct timespec timespec = { - .tv_sec = 0, - .tv_nsec = 100000000, // 100ms - }; - nanosleep(×pec, NULL); // ignore error - terminate_server(server->process); if (server->adb_reverse_enabled) {