From bae3a4fd9406635608edf0c0d16c52cf7ca06a66 Mon Sep 17 00:00:00 2001
From: fujuntang <fujuntang@smartai.com>
Date: 星期六, 23 十月 2021 15:20:57 +0800
Subject: [PATCH] Optimize the code source.

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

diff --git a/src/net/net_mod_socket.cpp b/src/net/net_mod_socket.cpp
index 2f5ce73..c48c33b 100644
--- a/src/net/net_mod_socket.cpp
+++ b/src/net/net_mod_socket.cpp
@@ -46,10 +46,6 @@
   return shmModSocket.force_bind(key);
 }
 
-int NetModSocket::bind_proc_id(char *buf, int len) {
-  return shmModSocket.bind_proc_id(buf, len);
-}
-
 int NetModSocket::reg(void *pData, int len, void **buf, int *size, const int timeout_ms, int flag) {
   
   return shmModSocket.reg(pData, len, buf, size, timeout_ms, flag);
@@ -345,6 +341,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