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 |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/utest/api_test.cpp b/utest/api_test.cpp
index 5363d6e..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;

--
Gitblit v1.8.0