From ccf72bb0b8aa9c421bb2964acca2dcd868d10a94 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期二, 18 五月 2021 11:41:46 +0800 Subject: [PATCH] use more rational node timeout, 60s. --- src/defs.cpp | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/defs.cpp b/src/defs.cpp index b812b65..cb85db7 100644 --- a/src/defs.cpp +++ b/src/defs.cpp @@ -132,7 +132,6 @@ InitMQ(info.mq_sender_, NextId()); InitMQ(info.mq_center_, NextId()); InitMQ(info.mq_bus_, NextId()); - InitMQ(info.mq_init_, NextId()); pmeta->tag_ = kCenterInfoTag; return true; @@ -141,10 +140,17 @@ return false; } -uint64_t BHGlobalSenderAddress() { return GetCenterInfo(BHomeShm())->mq_sender_.id_; } -uint64_t BHTopicCenterAddress() { return GetCenterInfo(BHomeShm())->mq_center_.id_; } -uint64_t BHTopicBusAddress() { return GetCenterInfo(BHomeShm())->mq_bus_.id_; } -uint64_t BHCenterReplyAddress() { return GetCenterInfo(BHomeShm())->mq_init_.id_; } +const MQInfo &BHGlobalSenderAddress() { return GetCenterInfo(BHomeShm())->mq_sender_; } +const MQInfo &BHTopicCenterAddress() { return GetCenterInfo(BHomeShm())->mq_center_; } +const MQInfo &BHTopicBusAddress() { return GetCenterInfo(BHomeShm())->mq_bus_; } +bool BHNodeInit(const int64_t request, int64_t &reply) +{ + return GetCenterInfo(BHomeShm())->init_rr_.ClientRequest(request, reply); +} +void BHCenterHandleInit(std::function<int64_t(const int64_t)> const &onReq) +{ + GetCenterInfo(BHomeShm())->init_rr_.ServerProcess(onReq); +} int64_t CalcAllocIndex(int64_t size) { @@ -181,4 +187,6 @@ { ec = LastErrorStore().ec_; msg = LastErrorStore().msg_; -} \ No newline at end of file +} + +int NodeTimeoutSec() { return 60; } \ No newline at end of file -- Gitblit v1.8.0