diff --git a/server/wsproxy/jsondatamgr.cc b/server/wsproxy/jsondatamgr.cc index c22ce6b..d492587 100644 --- a/server/wsproxy/jsondatamgr.cc +++ b/server/wsproxy/jsondatamgr.cc @@ -82,16 +82,3 @@ std::shared_ptr JsonDataMgr::GetMasterServerClusterConf() { return std::make_shared(masterserver_cluster_json_); } -bool JsonDataMgr::GetNodeHost(int node_id, std::string& host) -{ - bool found = false; - node_host_mutex_->lock(); - auto itr = node_host_hash_.find(node_id); - if (itr != node_host_hash_.end()) { - //!!!因为std::string基于引用计数多线程下直接复制的话会有问题,所以要用这种方式赋值 - host = itr->second.c_str(); - found = true; - } - node_host_mutex_->unlock(); - return found; -} diff --git a/server/wsproxy/jsondatamgr.h b/server/wsproxy/jsondatamgr.h index d5b2c3c..ce0797e 100644 --- a/server/wsproxy/jsondatamgr.h +++ b/server/wsproxy/jsondatamgr.h @@ -14,7 +14,6 @@ class JsonDataMgr : public a8::Singleton std::shared_ptr GetConf(); std::shared_ptr GetMasterServerClusterConf(); - bool GetNodeHost(int node_id, std::string& host); std::string GetUdpHost() { return udp_host_; } int GetUdpPort() { return udp_port_; }