From 5fb901dd157b4a8bbfc3be916c6c1a9d02b5bfa6 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期日, 29 一月 2023 09:56:56 +0800
Subject: [PATCH] robust

---
 main.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/main.cpp b/main.cpp
index 1196dfe..5982b67 100644
--- a/main.cpp
+++ b/main.cpp
@@ -4,13 +4,14 @@
 #include <string>
 #include <thread>
 #include <memory>
-using namespace std;
 
 #include "cbhomeclient.h"
 #include "message.h"
 
 // #include "3rdparty/bus_nng/bn_api.h"
 #include "bhome_msg_api.pb.h"
+
+using namespace std;
 using namespace bhome_msg;
 
 template <class F> void ignoref(F&& f){}
@@ -62,6 +63,11 @@
         auto msg = bus_client_get_submsg(handle);
         printf("SUB msg topic [%s] data [%s]\n", msg->topic, msg->msg);
         free_submsg(msg);
+
+        size_t count = 0;
+        auto p = bus_client_query_procs(handle, &count);
+        printf("bus_client_query_procs size %lu\n", count);
+        free_query_procs(p, count);
     }
 
     bus_client_free(handle);
@@ -135,6 +141,7 @@
     printf("start RR\n");
     const char* rrtopic = "cbhomeclient_req_rep";
     thread([&]{ req(rrtopic); }).detach();
+
     reply(rrtopic);
 
     return 0;

--
Gitblit v1.8.0