From 83085f2ce99cca05d40a19482151873a55e6393a Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 02 四月 2021 19:32:21 +0800 Subject: [PATCH] refactor center; add async request no cb. --- src/center.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/center.h b/src/center.h index 153cc3e..f0a177c 100644 --- a/src/center.h +++ b/src/center.h @@ -18,8 +18,24 @@ #ifndef CENTER_TM9OUQTG #define CENTER_TM9OUQTG +#include "socket.h" +#include <functional> + class BHCenter { + typedef ShmSocket Socket; + +public: + typedef std::function<bool(ShmSocket &socket, bhome_msg::MsgI &imsg, bhome::msg::BHMsg &msg)> MsgHandler; + + BHCenter(Socket::Shm &shm); + BHCenter(); + ~BHCenter() { Stop(); } + bool Start(); + bool Stop() { return socket_.Stop(); } + +private: + ShmSocket socket_; }; #endif // end of include guard: CENTER_TM9OUQTG -- Gitblit v1.8.0