| | |
| | | int nready; /* Number of ready descriptors from select */ |
| | | int maxi; /* Highwater index into client array */ |
| | | int clientfd[FD_SETSIZE]; /* Set of active descriptors */ |
| | | rio_t clientrio[FD_SETSIZE]; /* Set of active read buffers */ |
| | | // rio_t clientrio[FD_SETSIZE]; /* Set of active read buffers */ |
| | | } ; |
| | | |
| | | private: |
| | | int listenfd; |
| | | ShmModSocket * shm_mod_socket; |
| | | int port; |
| | | ShmModSocket shmModSocket; |
| | | pool pool; |
| | | |
| | | void *buf; |
| | | void *topic_buf; |
| | | char *response_buf; |
| | | |
| | | size_t max_buf; |
| | | size_t max_topic_buf; |
| | | size_t max_response_buf; |
| | | |
| | | |
| | | void init_pool(int listenfd); |
| | | void add_client(int connfd); |
| | | void check_clients(); |
| | | int process_client(int connfd); |
| | | |
| | | public: |
| | | |
| | | NetModServerSocket(int port, ShmModSocket *_shm_mod_socket); |
| | | void start(); |
| | | NetModServerSocket(int port); |
| | | |
| | | /* |
| | | * 启动 server |
| | | * @return 0 success, 其他 failture |
| | | */ |
| | | int start(); |
| | | ~NetModServerSocket(); |
| | | |
| | | }; |