summaryrefslogtreecommitdiff
path: root/src/miav_daemon.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/miav_daemon.cc')
-rw-r--r--src/miav_daemon.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/miav_daemon.cc b/src/miav_daemon.cc
index d86d448..97c26d7 100644
--- a/src/miav_daemon.cc
+++ b/src/miav_daemon.cc
@@ -37,6 +37,9 @@
#include "server.h"
#include "socket.h"
+// Declared in miavd.cc
+extern bool server_is_running;
+
MiavDaemon::MiavDaemon(int port)
{
this->port = port;
@@ -65,6 +68,8 @@ int MiavDaemon::daemon_main()
while(1) {
Socket *csocket = new Socket(socket->slisten());
+ if(!server_is_running) break;
+
if(socket->hasError()) {
ERR(miav, "Server socket has errors, quitting.");
delete csocket;
@@ -101,6 +106,9 @@ int MiavDaemon::daemon_main()
}
delete socket;
+
+ INFO(miav, "MIaV server stopped");
+
return 0;
}