| | |
| | | private: |
| | | |
| | | ShmModSocket shmModSocket; |
| | | // pool req_resp_pool; |
| | | NetConnPool *gpool; |
| | | |
| | | pthread_mutex_t sendMutex; |
| | | // pthread_mutex_t sendMutex; |
| | | |
| | | // request header 编码为网络传输的字节 |
| | | static void * encode_request_head(net_mod_request_head_t & request); |
| | |
| | | NetModSocket(); |
| | | ~NetModSocket(); |
| | | |
| | | |
| | | int stop(); |
| | | /** |
| | | * 绑定端口到socket, 如果不绑定则系统自动分配一个 |
| | | * @return 0 成功, 其他值 失败的错误码 |
| | |
| | | int sendandrecv_timeout( const void *send_buf, const int send_size, const int send_key, void **recv_buf, int *recv_size, int sec, int nsec) ; |
| | | int sendandrecv_nowait( const void *send_buf, const int send_size, const int send_key, void **recv_buf, int *recv_size) ; |
| | | |
| | | |
| | | /** |
| | | |
| | | |
| | | |
| | | /** |
| | | * recvandsend |
| | | */ |
| | | int recvandsend( recvandsend_callback_fn callback, |
| | | const struct timespec *timeout = NULL , int flag = 0, void * user_data = NULL ); |
| | | |
| | | /** |
| | | * 向node_arr 中的所有网络节点发布消息 |
| | | * @node_arr 网络节点组, @node_arr_len该数组长度 |
| | | * @topic 主题,@topic_size 该主题的长度 |