From 3e9f5b869dd32441fdd3d77091cb33ef4301f244 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期二, 06 四月 2021 20:26:20 +0800
Subject: [PATCH] use BHCenter.

---
 src/pubsub.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/pubsub.cpp b/src/pubsub.cpp
index 8d26e0b..0266c86 100644
--- a/src/pubsub.cpp
+++ b/src/pubsub.cpp
@@ -30,7 +30,7 @@
 			return false;
 		}
 		DEFER1(imsg.Release(shm()));
-		return ShmMsgQueue::Send(shm(), kBHTopicBus, imsg, timeout_ms);
+		return ShmMsgQueue::Send(shm(), BHTopicBusAddress(), imsg, timeout_ms);
 	} catch (...) {
 		return false;
 	}
@@ -39,7 +39,7 @@
 bool SocketSubscribe::Subscribe(const std::vector<Topic> &topics, const int timeout_ms)
 {
 	try {
-		return mq().Send(kBHTopicBus, MakeSub(mq().Id(), topics), timeout_ms);
+		return mq().Send(BHTopicBusAddress(), MakeSub(mq().Id(), topics), timeout_ms);
 	} catch (...) {
 		return false;
 	}
@@ -49,7 +49,7 @@
 {
 	auto AsyncRecvProc = [this, tdcb](BHMsg &msg) {
 		if (msg.type() == kMsgTypePublish) {
-			DataPub d;
+			MsgPub d;
 			if (d.ParseFromString(msg.body())) {
 				tdcb(d.topic(), d.data());
 			}
@@ -65,7 +65,7 @@
 {
 	BHMsg msg;
 	if (SyncRecv(msg, timeout_ms) && msg.type() == kMsgTypePublish) {
-		DataPub d;
+		MsgPub d;
 		if (d.ParseFromString(msg.body())) {
 			d.mutable_topic()->swap(topic);
 			d.mutable_data()->swap(data);

--
Gitblit v1.8.0