| | |
| | | #define PUT(p, val) (*(uint32_t *)(p) = (val)) |
| | | |
| | | |
| | | #define ERROR_NET_MOD_SOCKET_ADDR_IN_USE 1 |
| | | #define ERROR_NET_MOD_SOCKET_ADDR_IN_USE 1 |
| | | |
| | | |
| | | |
| | | |
| | | class NetModServerSocket; |
| | |
| | | int nready; /* Number of ready descriptors from select */ |
| | | int maxi; /* Highwater index into client array */ |
| | | struct pollfd conns[OPEN_MAX]; |
| | | // net_node_t *nodes[FD_SETSIZE]; |
| | | // rio_t clientrio[FD_SETSIZE]; /* Set of active read buffers */ |
| | | // std::map<int, net_node_t*> connfdNodeMap; |
| | | std::map<std::string, int> connectionMap; |
| | | // std::map<std::string, int> connectionMap; |
| | | } ; |
| | | |
| | | friend class NetModServerSocket; |
| | | private: |
| | | |
| | | ShmModSocket shmModSocket; |
| | | pool req_resp_pool; |
| | | // pool req_resp_pool; |
| | | |
| | | |
| | | |
| | |
| | | static void * encode_response_head(net_mod_response_head_t & response); |
| | | static net_mod_response_head_t decode_response_head(void *_headbs); |
| | | |
| | | void init_req_rep_req_resp_pool(); |
| | | int connect( net_node_t*); |
| | | void close_connect(int connfd); |
| | | void init_conn_pool( pool& mpool); |
| | | int connect(pool& mpool, net_node_t* node); |
| | | void close_connect(pool& mpool , int connfd); |
| | | int read_response(int clientfd, net_mod_recv_msg_t *recv_msg); |
| | | int write_request(int clientfd, net_mod_request_head_t &request_head, void *send_buf, int send_size); |
| | | |
| | | int _sendandrecv_(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 timeout); |
| | | |
| | | |
| | | |
| | | public: |
| | | |
| | |
| | | net_mod_recv_msg_t ** recv_arr, int *recv_arr_size); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 发送信息 |
| | | * @key 发送给谁 |