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.
#include <SDL2/SDL_net.h>
#include <errno.h>
#include <stdint.h>
-#include <time.h>
#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(&timespec, NULL); // ignore error
-
terminate_server(server->process);
if (server->adb_reverse_enabled) {
