From 9243710ca372de26823c2225c7b46b072458c671 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 28 五月 2021 17:18:33 +0800 Subject: [PATCH] tcp proxy requests, need more test. --- box/io_service.h | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/box/io_service.h b/box/io_service.h index 000facc..f492e71 100644 --- a/box/io_service.h +++ b/box/io_service.h @@ -24,19 +24,17 @@ class IoService { public: - IoService() : - run_(false) {} - bool Start(); - void Stop(); + IoService(); + ~IoService(); typedef boost::asio::io_context io_service_t; io_service_t &io() { return io_; } private: - virtual void OnStop() {} io_service_t io_; + typedef boost::asio::executor_work_guard<io_service_t::executor_type> guard_t; + guard_t guard_; std::thread worker_; - std::atomic<bool> run_; }; #endif // end of include guard: IO_SERVICE_ODKKJG3D -- Gitblit v1.8.0