From 9f9d05d8cfb8076a4067a0e3c7561781521225ed Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期二, 18 五月 2021 17:31:45 +0800 Subject: [PATCH] trivial. --- src/topic_node.cpp | 11 +++-------- box/box.cc | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/box/box.cc b/box/box.cc index f83f2fd..6f07fa7 100644 --- a/box/box.cc +++ b/box/box.cc @@ -41,7 +41,7 @@ } return false; } - void Apply(std::function<void(const std::string &id, const std::string &desc)> f) const + void Apply(std::function<void(const std::string &id, const std::string &desc)> const &f) const { for (auto &kv : functions_) { f(kv.second.id_, kv.second.desc_); diff --git a/src/topic_node.cpp b/src/topic_node.cpp index 6be65be..a3f3428 100644 --- a/src/topic_node.cpp +++ b/src/topic_node.cpp @@ -107,14 +107,9 @@ } SetProcIndex(reply.proc_index()); this->state_ = eStateUnregistered; - auto onRequest = [this](ShmSocket &socket, MsgI &msg, BHMsgHead &head) { - server_buffer_->Write(std::move(head), msg.body()); - }; - SockServer().Start(onRequest); - auto onSub = [this](ShmSocket &socket, MsgI &msg, BHMsgHead &head) { - sub_buffer_->Write(std::move(head), msg.body()); - }; - SockSub().Start(onSub); + + ServerStart(ServerAsyncCB(), 1); + SubscribeStartWorker(SubDataCB(), 1); } } break; default: break; -- Gitblit v1.8.0