From d6a27f15acd08e99841595cece2b3e3e8045491a Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期二, 13 十月 2020 18:15:55 +0800 Subject: [PATCH] update --- src/libshm_queue.a | 0 src/socket/net_mod_socket.h | 6 ++++-- test_net_socket/net_mod_socket.c | 0 test_net_socket/net_mod_socket.sh | 6 +++--- test_net_socket/Makefile | 9 +++------ 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/libshm_queue.a b/src/libshm_queue.a index 8260732..ceab04f 100644 --- a/src/libshm_queue.a +++ b/src/libshm_queue.a Binary files differ diff --git a/src/socket/net_mod_socket.h b/src/socket/net_mod_socket.h index f9080ab..4807a69 100644 --- a/src/socket/net_mod_socket.h +++ b/src/socket/net_mod_socket.h @@ -10,6 +10,8 @@ #define NET_MODE_REQUEST_HEAD_LENGTH 16 #define NET_MODE_RESPONSE_HEAD_LENGTH 4 +class NetModServerSocket; + struct net_node_t { const char *host; @@ -43,7 +45,7 @@ }; class NetModSocket { - + friend class NetModServerSocket; private: static std::map<std::string, rio_t *> connectionMap; ShmModSocket shmModSocket; @@ -54,7 +56,7 @@ static void * encode_response_head(net_mod_response_head_t & response); static net_mod_response_head_t decode_response_head(void *_headbs); - + public: NetModSocket(); diff --git a/test_net_socket/Makefile b/test_net_socket/Makefile index 56d3c29..12ece03 100644 --- a/test_net_socket/Makefile +++ b/test_net_socket/Makefile @@ -13,17 +13,14 @@ INCLUDES += -I${DEST}/include/shmqueue -I$(ROOT)/include/usgcommon -PROGS = ${DEST}/net_mod_req_rep +PROGS = ${DEST}/net_mod_socket DEPENDENCES = $(patsubst %, %.d, $(PROGS)) #LIBCOMMON=${ROOT}/lib/libusgcommon.a -build: $(PROGS) - cp -a net_mod_req_rep.sh ${DEST} - -# class -#$(DEST)/kucker : kucker.c +build: $(PROGS) + cp -a net_mod_socket.sh ${DEST} clean: diff --git a/test_net_socket/net_mod_req_rep.c b/test_net_socket/net_mod_socket.c similarity index 100% rename from test_net_socket/net_mod_req_rep.c rename to test_net_socket/net_mod_socket.c diff --git a/test_net_socket/net_mod_req_rep.sh b/test_net_socket/net_mod_socket.sh similarity index 69% rename from test_net_socket/net_mod_req_rep.sh rename to test_net_socket/net_mod_socket.sh index 383c7f2..2b14632 100755 --- a/test_net_socket/net_mod_req_rep.sh +++ b/test_net_socket/net_mod_socket.sh @@ -7,16 +7,16 @@ ./dgram_mod_bus server 8 & - ./net_mod_req_rep server 5000 & + ./net_mod_socket server 5000 & } function client() { - ./net_mod_req_rep client 5000 + ./net_mod_socket client 5000 } function close() { - ps -ef | grep -e "dgram_mod_req_rep" -e "net_mod_req_rep" -e "dgram_mod_bus" | awk '{print $2}' | xargs -i kill -9 {} + ps -ef | grep -e "dgram_mod_req_rep" -e "net_mod_socket" -e "dgram_mod_bus" | awk '{print $2}' | xargs -i kill -9 {} ipcrm -a } -- Gitblit v1.8.0