From 2a4e4619f34a742e36693e589e0431347a72979b Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期二, 13 十月 2020 17:36:32 +0800
Subject: [PATCH] update

---
 src/socket/net_mod_socket.h |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/socket/net_mod_socket.h b/src/socket/net_mod_socket.h
index 93b3ad3..d296007 100644
--- a/src/socket/net_mod_socket.h
+++ b/src/socket/net_mod_socket.h
@@ -4,6 +4,12 @@
 #include "shm_mod_socket.h"
 #include "socket_io.h"
 
+#define GET(p)       (*(uint32_t *)(p))
+#define PUT(p, val)  (*(uint32_t *)(p) = (val))
+
+#define NET_MODE_REQUEST_HEAD_LENGTH 16
+#define NET_MODE_RESPONSE_HEAD_LENGTH 4
+
 struct net_node_t
 {
 	const char *host;
@@ -16,6 +22,7 @@
 	uint32_t mod;
 	uint32_t key;
 	uint32_t content_length;
+	uint32_t topic_length;
 };
 
 struct net_mod_response_head_t {
@@ -43,14 +50,24 @@
 public:
 	
   NetModSocket();
+
   int sendandrecv(net_node_t *node_arr, int arrlen, void *send_buf, int send_size, 
   	net_mod_recv_msg_t ** resp_arr, int *resp_arr_size);
+
+  int pub(net_node_t *node_arr, int arrlen, char *topic, int topic_size, void *content, int content_size);
  
   ~NetModSocket();
 
-   static void  free_recv_msg_arr(net_mod_recv_msg_t * arr, size_t size);
+  static void  free_recv_msg_arr(net_mod_recv_msg_t * arr, size_t size);
+
+  static void * encode_request_head(net_mod_request_head_t & request);
+  static net_mod_request_head_t  decode_request_head(void *headbs);
+
+	static void * encode_response_head(net_mod_response_head_t & response);
+	static net_mod_response_head_t  decode_response_head(void *_headbs);
 };
 
 
+
  
 #endif
\ No newline at end of file

--
Gitblit v1.8.0