From de80ed87b8339f23624642786698057a62bdf779 Mon Sep 17 00:00:00 2001
From: fujuntang <fujuntang@smartai.com>
Date: 星期二, 23 十一月 2021 11:25:48 +0800
Subject: [PATCH] Fix the communication failure issue when the registered applications exceeds the fixed amount.

---
 src/net/net_mod_socket.cpp |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/net/net_mod_socket.cpp b/src/net/net_mod_socket.cpp
index b3aa9b0..acd9053 100644
--- a/src/net/net_mod_socket.cpp
+++ b/src/net/net_mod_socket.cpp
@@ -121,7 +121,6 @@
   if (mpool == NULL)
   {
     /* If first call from this thread, allocate buffer for thread, and save its location */
-    logger->debug("Create connPool");
     mpool = new NetConnPool();
     if (mpool == NULL) {
       LoggerFactory::getLogger()->error(errno, "NetModSocket::_sendandrecv_ malloc");
@@ -341,6 +340,25 @@
      
 }
 
+void NetModSocket::buf_data_set(std::string str, int val) {
+  recvbuf.insert({str, val}); 
+}
+
+int NetModSocket::buf_data_get(std::string str) {
+  
+  int i;
+  int val = 0;
+  std::map<std::string, int>::iterator recvIter;
+
+  recvIter = recvbuf.find(str);
+  if(recvIter != recvbuf.end()) {
+    
+    val = recvIter->second;
+
+  }
+
+  return val;
+}
 
 void NetModSocket::free_recv_msg_arr(net_mod_recv_msg_t * arr, size_t size) {
 

--
Gitblit v1.8.0