From aa2f3b2a9968bb4928463bdae05fb026d16b60bb Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期五, 04 十二月 2020 19:07:01 +0800 Subject: [PATCH] 固定bus key --- src/socket/net_mod_server_socket.h | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/socket/net_mod_server_socket.h b/src/socket/net_mod_server_socket.h index 13e43f7..3f80931 100644 --- a/src/socket/net_mod_server_socket.h +++ b/src/socket/net_mod_server_socket.h @@ -23,26 +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; + int port; ShmModSocket shmModSocket; pool pool; - void *buf = NULL; + 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(rio_t *rio, int connfd); + int process_client(int connfd); public: NetModServerSocket(int port); - void start(); + + /* + * 鍚姩 server + * @return 0 success, 鍏朵粬 failture + */ + int start(); ~NetModServerSocket(); }; -- Gitblit v1.8.0