From d26327b3cde043a9470dcd7fea8e704ea517fdae Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期四, 01 四月 2021 19:26:57 +0800
Subject: [PATCH] add req/rep center;

---
 src/pubsub_center.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/pubsub_center.h b/src/pubsub_center.h
index 866216e..b752216 100644
--- a/src/pubsub_center.h
+++ b/src/pubsub_center.h
@@ -23,7 +23,6 @@
 #include <mutex>
 #include <set>
 #include <unordered_map>
-using namespace bhome_shm;
 
 // publish/subcribe manager.
 class PubSubCenter
@@ -31,18 +30,19 @@
 	class SocketBus : public ShmSocket
 	{
 	public:
-		SocketBus(SharedMemory &shm) :
-		    ShmSocket(shm, &kBHBusQueueId, 1000) {}
+		SocketBus(ShmSocket::Shm &shm) :
+		    ShmSocket(shm, &kBHTopicBus, 1000) {}
 		using ShmSocket::shm;
 	};
 	SocketBus socket_;
+	ShmSocket::Shm &shm() { return socket_.shm(); }
 	std::mutex mutex_;
 	typedef std::set<MQId> Clients;
 	std::unordered_map<std::string, Clients> records_;
-	ShmSocket::Shm &shm() { return socket_.shm(); }
 
 public:
-	PubSubCenter(SharedMemory &shm);
+	PubSubCenter(ShmSocket::Shm &shm) :
+	    socket_(shm) {}
 	PubSubCenter() :
 	    PubSubCenter(BHomeShm()) {}
 	~PubSubCenter() { Stop(); }

--
Gitblit v1.8.0