From db322f33ba13592f2492317e3f1a070454c97059 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期四, 13 五月 2021 19:34:46 +0800
Subject: [PATCH] center alloc all msgs.

---
 src/topic_node.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/topic_node.h b/src/topic_node.h
index 338a6e3..b018807 100644
--- a/src/topic_node.h
+++ b/src/topic_node.h
@@ -130,6 +130,14 @@
 	ShmSocket &SockClient() { return *sockets_[eSockClient]; }
 	ShmSocket &SockServer() { return *sockets_[eSockServer]; }
 
+	void SetProcIndex(int index)
+	{
+		proc_index_ = index;
+		for (int i = eSockStart; i < eSockEnd; ++i) {
+			sockets_[i]->SetNodeProc(index, i);
+		}
+	}
+
 	enum State {
 		eStateUnregistered,
 		eStateOnline,
@@ -144,6 +152,7 @@
 	std::mutex mutex_;
 	MQId ssn_id_ = 0;
 	std::atomic<State> state_;
+	int proc_index_ = -1;
 
 	TopicQueryCache topic_query_cache_;
 };

--
Gitblit v1.8.0