refactoors
[mTask.git] / client / client.c
index 19a68e9..da74940 100644 (file)
@@ -12,6 +12,7 @@
 #include "sds.h"
 #include "spec.h"
 #include "task.h"
+#include "mem.h"
 #include "interface.h"
 
 #define MSG_GET_TASK 't'
@@ -20,6 +21,7 @@
 #define MSG_SDS_DEL 'a'
 #define MSG_SDS_UPD 'u'
 #define MSG_SPEC 'c'
+#define MSG_SHUTDOWN 'h'
 
 #define LOOPDELAY 100
 
@@ -61,6 +63,11 @@ void read_message(void)
         debug("Receiving a spec request");
         spec_send();
         break;
+      case MSG_SHUTDOWN:
+       debug("Shutdown received");
+       mem_reset();
+       reset();
+       break;
       case '\0':
         debug("Server closed connection");
         break;