From c1e39e20ca42b21eeac8b5068fa1f921bf9a070f Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期三, 23 六月 2021 19:43:29 +0800 Subject: [PATCH] refactor, start tcp pub/sub. --- utest/api_test.cpp | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/utest/api_test.cpp b/utest/api_test.cpp index b4e0f4b..239ea8b 100644 --- a/utest/api_test.cpp +++ b/utest/api_test.cpp @@ -256,14 +256,21 @@ printf("proc [%d] %s, %s, %s\n\ttopics\n", i, (info.online() ? "online" : "offline"), info.proc().proc_id().c_str(), info.proc().name().c_str()); - for (auto &t : info.topics().topic_list()) { - printf("\t\t %s\n", t.c_str()); - } + auto PrintTopics = [](std::string const &name, auto &topic_list) { + printf("%s:[", name.c_str()); + for (auto &t : topic_list) { + printf("%s,", t.c_str()); + } + printf("]\n"); + }; + PrintTopics("service", info.service().topic_list()); + PrintTopics("local_sub", info.local_sub().topic_list()); + PrintTopics("net_sub", info.net_sub().topic_list()); printf("\n"); } printf("\n"); }; - if (0) { + if (1) { // query procs std::string dest(BHAddress().SerializeAsString()); MsgQueryProc query; @@ -293,8 +300,8 @@ host.set_ip("127.0.0.1"); host.set_port(kBHCenterPort); // center topic node address. - host.set_mq_id(201); - host.set_abs_addr(10072); + // host.set_mq_id(201); + // host.set_abs_addr(10072); std::string dest(host.SerializeAsString()); void *proc_id = 0; -- Gitblit v1.8.0