wangzhengquan
2020-10-13 d6a27f15acd08e99841595cece2b3e3e8045491a
update
2 文件已重命名
3个文件已修改
21 ■■■■ 已修改文件
src/libshm_queue.a 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/net_mod_socket.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_net_socket/Makefile 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_net_socket/net_mod_socket.c 补丁 | 查看 | 原始文档 | blame | 历史
test_net_socket/net_mod_socket.sh 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/libshm_queue.a
Binary files differ
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();
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:
test_net_socket/net_mod_socket.c
test_net_socket/net_mod_socket.sh
File was renamed from test_net_socket/net_mod_req_rep.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
}