From 251bbc8b0ebd9a91d34f81186d9284f6e669b4db Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期三, 27 一月 2021 10:13:48 +0800 Subject: [PATCH] update --- src/net/net_mod_socket.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/net/net_mod_socket.cpp b/src/net/net_mod_socket.cpp index 73be131..baeef65 100644 --- a/src/net/net_mod_socket.cpp +++ b/src/net/net_mod_socket.cpp @@ -345,6 +345,7 @@ if(ret == 0 ) { n_pub_suc++; } + return n_pub_suc; } for (i = 0; i < arrlen; i++) { @@ -374,7 +375,7 @@ } request_head.mod = BUS; memcpy(request_head.host, node->host, sizeof(request_head.host)); - request_head.key = node->key; + request_head.key = SHM_BUS_KEY; request_head.content_length = content_size; request_head.topic_length = strlen(topic) + 1; request_head.timeout = msec; @@ -513,10 +514,12 @@ * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ int NetModSocket::recvfrom(void **buf, int *size, int *key) { + + logger->debug(" %d NetModSocket::recvfrom before", get_key()); int rv = shmModSocket.recvfrom(buf, size, key); if(rv == 0) { - logger->debug("NetModSocket::recvfrom: %d recvfrom %d success.\n", get_key(), *key); + logger->debug("NetModSocket::recvfrom: <<<< %d recvfrom %d success.\n", get_key(), *key); return 0; } @@ -533,7 +536,7 @@ struct timespec timeout = {sec, nsec}; int rv = shmModSocket.recvfrom_timeout(buf, size, key, &timeout); if(rv == 0) { - logger->debug("NetModSocket::recvfrom: %d recvfrom %d success.\n", get_key(), *key); + logger->debug("NetModSocket::recvfrom_timeout: %d recvfrom %d success.\n", get_key(), *key); return 0; } @@ -549,7 +552,7 @@ int NetModSocket::recvfrom_nowait(void **buf, int *size, int *key){ int rv = shmModSocket.recvfrom_nowait(buf, size, key); if(rv == 0) { - logger->debug("NetModSocket::recvfrom: %d recvfrom %d success.\n", get_key(), *key); + logger->debug("NetModSocket::recvfrom_nowait: %d recvfrom %d success.\n", get_key(), *key); return 0; } -- Gitblit v1.8.0