From d738c67b21b73a0c513d5ce28f08f0d7fdef126f Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期一, 30 十一月 2020 10:29:05 +0800
Subject: [PATCH] update

---
 src/socket/net_mod_socket_wrapper.h   |    4 ++--
 test_net_socket/test_net_mod_socket.c |    2 +-
 src/socket/net_mod_socket.h           |    2 +-
 src/socket/net_mod_socket_wrapper.c   |    7 +++++++
 src/Makefile                          |    2 +-
 test_net_socket/Makefile              |    4 ++--
 src/socket/net_mod_server_socket.c    |    2 +-
 7 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index b1759a6..d802507 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -16,7 +16,7 @@
 
 #-I$(ROOT)/include/usgcommon
 
-INCLUDES += -I./queue -I./socket -I./common/include -I$(ROOT)/include/usgcommon
+INCLUDES += -I./queue -I./socket  -I$(ROOT)/include/usgcommon
 
 SOURCES := $(wildcard *.c ./**/*.c)
 OBJS   = $(patsubst %.c, $(DEST)/%.o, $(SOURCES)) 
diff --git a/src/socket/net_mod_server_socket.c b/src/socket/net_mod_server_socket.c
index bc5923a..0808d0b 100644
--- a/src/socket/net_mod_server_socket.c
+++ b/src/socket/net_mod_server_socket.c
@@ -51,7 +51,7 @@
   sprintf(portstr, "%d", port);
   listenfd = open_listenfd(portstr);
   if(listenfd < 0) {
-    LoggerFactory::getLogger()->error(errno, "NetModServerSocket::start");
+    LoggerFactory::getLogger()->error(errno, "NetModServerSocket::start . errno=%d", errno);
     return -1;
   }
   init_pool(listenfd);
diff --git a/src/socket/net_mod_socket.h b/src/socket/net_mod_socket.h
index dfb7c11..d670731 100644
--- a/src/socket/net_mod_socket.h
+++ b/src/socket/net_mod_socket.h
@@ -10,7 +10,7 @@
 #define PUT(p, val)  (*(uint32_t *)(p) = (val))
 
 
-
+#define ERROR_NET_MOD_SOCKET_ADDR_IN_USE 1  
 
 
 class NetModServerSocket;
diff --git a/src/socket/net_mod_socket_wrapper.c b/src/socket/net_mod_socket_wrapper.c
index e3d5c8d..d597644 100644
--- a/src/socket/net_mod_socket_wrapper.c
+++ b/src/socket/net_mod_socket_wrapper.c
@@ -125,6 +125,13 @@
 	net_mod_socket_t *sockt = (net_mod_socket_t *)_socket;
 	return sockt->sockt->pub(node_arr, node_arr_len, topic, topic_size, content, content_size);
 }
+int net_mod_socket_pub_timeout(void *_sockt, net_node_t *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size, int timeout){
+	return 0;
+}
+int net_mod_socket_pub_nowait(void *_sockt, net_node_t *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size){
+	return 0;
+}
+
 
 
 
diff --git a/src/socket/net_mod_socket_wrapper.h b/src/socket/net_mod_socket_wrapper.h
index 562ce1d..9bbdb21 100644
--- a/src/socket/net_mod_socket_wrapper.h
+++ b/src/socket/net_mod_socket_wrapper.h
@@ -101,8 +101,8 @@
  * @return 鎴愬姛鍙戝竷鐨勮妭鐐圭殑涓暟
  */
 int net_mod_socket_pub(void *_sockt, net_node_t *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size);
-
-
+int net_mod_socket_pub_timeout(void *_sockt, net_node_t *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size, int timeout);
+int net_mod_socket_pub_nowait(void *_sockt, net_node_t *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size);
 
 /**
  * 璁㈤槄鎸囧畾涓婚
diff --git a/test_net_socket/Makefile b/test_net_socket/Makefile
index 58fb9f7..0d8505f 100644
--- a/test_net_socket/Makefile
+++ b/test_net_socket/Makefile
@@ -3,9 +3,9 @@
 PLATFORM=$(shell $(ROOT)/systype.sh)
 include $(ROOT)/Make.defines.$(PLATFORM)
 
-#RPATH += -Wl,-rpath=${ROOT}/lib
+RPATH += -Wl,-rpath=$(ROOT)/lib:$(DEST)/lib
 # 寮�婧愬伐鍏峰寘璺緞
-LDDIR += -L${DEST}/lib
+LDDIR += -L$(DEST)/lib
 
 #-lusgcommon
 # 寮�婧愬伐鍏峰寘
diff --git a/test_net_socket/test_net_mod_socket.c b/test_net_socket/test_net_mod_socket.c
index 4989b14..6527a4e 100644
--- a/test_net_socket/test_net_mod_socket.c
+++ b/test_net_socket/test_net_mod_socket.c
@@ -29,7 +29,7 @@
   printf("Start net proxy\n");
 	void *serverSocket  = net_mod_server_socket_open(port);
 	if(net_mod_server_socket_start(serverSocket) != 0) {
-		err_exit(errno, "net_mod_server_socket_start");
+		err_msg(errno, "net_mod_server_socket_start");
 	}
 }
 

--
Gitblit v1.8.0