1
This commit is contained in:
parent
b24c4c73e7
commit
a490983b75
@ -82,16 +82,3 @@ std::shared_ptr<a8::XObject> JsonDataMgr::GetMasterServerClusterConf()
|
||||
{
|
||||
return std::make_shared<a8::XObject>(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;
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
||||
|
||||
std::shared_ptr<a8::XObject> GetConf();
|
||||
std::shared_ptr<a8::XObject> GetMasterServerClusterConf();
|
||||
bool GetNodeHost(int node_id, std::string& host);
|
||||
std::string GetUdpHost() { return udp_host_; }
|
||||
int GetUdpPort() { return udp_port_; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user