| | |
| | | |
| | | namespace |
| | | { |
| | | const std::string &kTopicQueryProc = "@center_query_procs"; |
| | | const std::string &kTopicQueryProc = "#center_query_procs"; |
| | | |
| | | std::string ToJson(const MsgQueryProcReply &qpr) |
| | | { |
| | |
| | | MsgCommonReply reply; |
| | | |
| | | ProcInfo info; |
| | | info.set_proc_id("#center.node"); |
| | | info.set_proc_id("@center.node"); |
| | | info.set_name("center node"); |
| | | if (!pnode_->UniRegister(true, info, reply, timeout)) { |
| | | Json jinfo; |
| | | jinfo.put("description", "some center services. Other nodes may use topics to use them."); |
| | | info.set_public_info(jinfo.dump()); |
| | | if (!pnode_->DoRegister(true, info, reply, timeout)) { |
| | | throw std::runtime_error("center node register failed."); |
| | | } |
| | | |
| | | MsgTopicList topics; |
| | | topics.add_topic_list(kTopicQueryProc); |
| | | if (!pnode_->ServerRegisterRPC(topics, reply, timeout)) { |
| | | if (!pnode_->DoServerRegisterRPC(true, topics, reply, timeout)) { |
| | | throw std::runtime_error("center node register topics failed."); |
| | | } |
| | | |