wangzhengquan
2020-11-30 d738c67b21b73a0c513d5ce28f08f0d7fdef126f
update
7个文件已修改
23 ■■■■■ 已修改文件
src/Makefile 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/net_mod_server_socket.c 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/net_mod_socket.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/net_mod_socket_wrapper.c 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/net_mod_socket_wrapper.h 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_net_socket/Makefile 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_net_socket/test_net_mod_socket.c 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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)) 
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);
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;
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;
}
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);
/**
 * 订阅指定主题
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
# 开源工具包
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");
    }
}