From 87b5445e2a08a18bbbe1e0ce63d5f65e81bfb79f Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期一, 18 一月 2021 15:09:30 +0800
Subject: [PATCH] update

---
 src/socket/net_mod_server_socket.cpp |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/socket/net_mod_server_socket.cpp b/src/socket/net_mod_server_socket.cpp
index 46c3bce..8324d6f 100644
--- a/src/socket/net_mod_server_socket.cpp
+++ b/src/socket/net_mod_server_socket.cpp
@@ -25,6 +25,8 @@
   if(response_buf == NULL) {
     err_exit(errno, "NetModServerSocket::NetModServerSocket malloc");
   }
+
+  shmModSocket.force_bind(SHM_NET_PROXY_KEY);
 }
 
 
@@ -179,7 +181,7 @@
     }
 
     if( ret != 0) {
-      // 娌℃湁瀵瑰簲鐨刱ey
+      // 杞彂澶辫触
       response_head.code = ret;
       response_head.content_length = 0;
       if( rio_writen(connfd, NetModSocket::encode_response_head(response_head), NET_MODE_RESPONSE_HEAD_LENGTH) != NET_MODE_RESPONSE_HEAD_LENGTH )
@@ -234,13 +236,13 @@
     if(request_head.timeout > 0) {
       timeout.tv_sec = request_head.timeout / 1000;
       timeout.tv_nsec = (request_head.timeout - timeout.tv_sec * 1000) * 10e6;
-      ret = shmModSocket.pub_timeout((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, BUS_KEY, &timeout);
+      ret = shmModSocket.pub_timeout((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, SHM_BUS_KEY, &timeout);
     }
     else if(request_head.timeout == 0) {
-      ret = shmModSocket.pub_nowait((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, BUS_KEY);
+      ret = shmModSocket.pub_nowait((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, SHM_BUS_KEY);
     }
     else if(request_head.timeout == -1) {
-      ret = shmModSocket.pub((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, BUS_KEY);
+      ret = shmModSocket.pub((char*)topic_buf, request_head.topic_length, buf, request_head.content_length, SHM_BUS_KEY);
     }
     response_head.code = ret;
     response_head.content_length = 0;

--
Gitblit v1.8.0