From 73ebfbc4f3fce4f7197b16b74ed4d6abaa9367b5 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期一, 11 一月 2021 19:34:42 +0800 Subject: [PATCH] update --- src/socket/net_mod_server_socket.h | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/socket/net_mod_server_socket.h b/src/socket/net_mod_server_socket.h index d908180..3f80931 100644 --- a/src/socket/net_mod_server_socket.h +++ b/src/socket/net_mod_server_socket.h @@ -23,22 +23,38 @@ 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(); }; -- Gitblit v1.8.0