Make server interruptible

Use an interruptor to immediately wake up blocking calls on
server_stop().
This commit is contained in:
Romain Vimont
2021-11-12 18:50:50 +01:00
parent 40340509d9
commit f488cbd7e7
2 changed files with 60 additions and 48 deletions

View File

@@ -10,6 +10,7 @@
#include "adb.h"
#include "coords.h"
#include "options.h"
#include "util/intr.h"
#include "util/log.h"
#include "util/net.h"
#include "util/thread.h"
@@ -50,6 +51,8 @@ struct server {
sc_cond cond_stopped;
bool stopped;
struct sc_intr intr;
sc_socket server_socket; // only used if !tunnel_forward
sc_socket video_socket;
sc_socket control_socket;