wangzhengquan
2021-01-15 0d6000e8e75e45d83dfc5718bd249a11fcce45a3
src/socket/net_mod_socket.h
@@ -5,7 +5,7 @@
#include "socket_io.h"
#include <poll.h>
#include "socket_def.h"
#include "net_conn_pool.h"
class NetModServerSocket;
@@ -63,7 +63,9 @@
   
  ShmModSocket shmModSocket;
  // pool req_resp_pool;
  NetConnPool *gpool;
  pthread_mutex_t sendMutex;
  // request header 编码为网络传输的字节
  static void * encode_request_head(net_mod_request_head_t & request);
@@ -77,6 +79,10 @@
  static void _destroyConnPool_(void *_pool);
  // 创建thread local key
  static void _createConnPoolKey_(void);
  NetConnPool* _get_threadlocal_pool();
  NetConnPool* _get_pool();
  //读取返回信息
  int read_response(int clientfd, net_mod_recv_msg_t *recv_msg);
@@ -151,8 +157,8 @@
   * 缺点:阻塞的,性能不如sendandrecv
   * 
   */
  int sendandrecv_safe(net_node_t *node_arr, int node_arr_len, void *send_buf, int send_size,
    net_mod_recv_msg_t ** recv_arr, int *recv_arr_size);
  // int sendandrecv_safe(net_node_t *node_arr, int node_arr_len, void *send_buf, int send_size,
  //   net_mod_recv_msg_t ** recv_arr, int *recv_arr_size);
 
  /**