From 026bbfaf2b5d73a26b8e2fa49158883ef64c211b Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期四, 27 五月 2021 13:51:26 +0800 Subject: [PATCH] tcp server call center to send proxy requests. --- box/tcp_server.h | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/box/tcp_server.h b/box/tcp_server.h index c06cddc..2c9337c 100644 --- a/box/tcp_server.h +++ b/box/tcp_server.h @@ -18,23 +18,23 @@ #ifndef TCP_SERVER_795VXR94 #define TCP_SERVER_795VXR94 +#include "bh_util.h" +#include "io_service.h" #include "tcp_common.h" -#include <thread> -class TcpServer +class NodeCenter; +class TcpServer : public IoService { public: - explicit TcpServer(int port); + typedef std::shared_ptr<Synced<NodeCenter>> CenterPtr; + TcpServer(int port, CenterPtr pscenter); ~TcpServer(); - bool Start(); - void Stop(); private: + virtual void OnStop(); void Accept(); - std::thread worker_; - std::atomic<bool> run_; - boost::asio::io_context io_; tcp::acceptor listener_; + CenterPtr pscenter_; }; #endif // end of include guard: TCP_SERVER_795VXR94 -- Gitblit v1.8.0