| | |
| | | #include "socket_io.h" |
| | | #include <poll.h> |
| | | #include "socket_def.h" |
| | | |
| | | #include "net_conn_pool.h" |
| | | |
| | | |
| | | class NetModServerSocket; |
| | |
| | | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | * 缺点:阻塞的,性能不如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); |
| | | |
| | | |
| | | /** |