From 5a9c69191a03fa6ec93419742fb843114d938136 Mon Sep 17 00:00:00 2001
From: Philippe PITTOLI
Date: Tue, 9 Oct 2018 03:09:45 +0200
Subject: [PATCH] message types => enumerations
---
core/ipc.cr | 6 ++----
core/msg.h | 11 ++++++-----
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/core/ipc.cr b/core/ipc.cr
index 12b3c8c..1ff516b 100644
--- a/core/ipc.cr
+++ b/core/ipc.cr
@@ -145,10 +145,8 @@ end
class IPC::Message
enum Type
- CLOSE
- CONNECTION
- SYN
- ACK
+ SERVER_CLOSE
+ ERROR
DATA
end
diff --git a/core/msg.h b/core/msg.h
index 48e306e..190b89d 100644
--- a/core/msg.h
+++ b/core/msg.h
@@ -5,13 +5,14 @@
#include
#include
-// FIXME, removed messages types: MSG_TYPE_CON, MSG_TYPE_CLOSE, MSG_TYPE_ACK
-// this implies an underlying communication that is always correctly handled by the system
+// the underlying communication must always correctly handled by the system
// (currently: unix sockets)
-#define MSG_TYPE_SERVER_CLOSE 0
-#define MSG_TYPE_ERR 1
-#define MSG_TYPE_DATA 2
+enum msg_types {
+ MSG_TYPE_SERVER_CLOSE = 0
+ , MSG_TYPE_ERR
+ , MSG_TYPE_DATA
+} message_types;
struct ipc_message {
char type;