| | |
| | | } |
| | | 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_); |
| | |
| | | } |
| | | 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; |