mirror of
https://github.com/Genymobile/scrcpy
synced 2024-12-29 10:42:17 +00:00
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.
This commit is contained in:
parent
c683872bbc
commit
7458d8271e
@ -4,7 +4,6 @@
|
||||
#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(×pec, NULL); // ignore error
|
||||
|
||||
terminate_server(server->process);
|
||||
|
||||
if (server->adb_reverse_enabled) {
|
||||
|
Loading…
Reference in New Issue
Block a user