From c6964d5af25d4ec7ed9dbe7674dc4e3896b36ead Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 16 四月 2021 16:10:02 +0800
Subject: [PATCH] node remove mq if never registered; refactor.

---
 box/center.cpp |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/box/center.cpp b/box/center.cpp
index a95e82d..e8d014e 100644
--- a/box/center.cpp
+++ b/box/center.cpp
@@ -97,12 +97,9 @@
 	NodeCenter(const std::string &id, const Cleaner &cleaner, const steady_clock::duration offline_time, const steady_clock::duration kill_time) :
 	    NodeCenter(id, cleaner, duration_cast<seconds>(offline_time).count(), duration_cast<seconds>(kill_time).count()) {}
 
-	const std::string &id() const
-	{
-		return id_;
-	} // no need to lock.
+	// center name, no relative to shm.
+	const std::string &id() const { return id_; }
 
-	//TODO maybe just return serialized string.
 	MsgCommonReply Register(const BHMsgHead &head, MsgRegister &msg)
 	{
 		if (msg.proc().proc_id() != head.proc_id()) {
@@ -523,7 +520,7 @@
 		printf("remove mq : %s\n", r ? "ok" : "failed");
 	};
 
-	AddCenter("#center", gc);
+	AddCenter("#bhome_center", gc);
 
 	for (auto &kv : Centers()) {
 		auto &info = kv.second;

--
Gitblit v1.8.0