1) brpc/channel.cpp
int Channel::Init(const char* ns_url, const char* lb_name, const ChannelOptions* options)
2) brpc/load_balancer_with_naming.cpp
int LoadBalancerWithNaming::Init(const char* ns_url, const char* lb_name, const NamingServiceFilter* filter, const GetNamingServiceThreadOptions* options)
int GetNamingServiceThread( butil::intrusive_ptr<NamingServiceThread>* nsthread_out, const char* url, const GetNamingServiceThreadOptions* options)
3) brpc/details/naming_service_thread.cpp
得到当前使用的名字协议和协议类型
eg:"bns://rdev.matrix.all"
service_name: rdev.matrix.all
protocol: bns
static const char* ParseNamingServiceUrl(const char* url, char* protocol)
4) brpc/details/naming_service_thread.cpp
int NamingServiceThread::Start(NamingService* naming_service, const std::string& protocol, const std::string& service_name, const GetNamingServiceThreadOptions* opt_in)
void NamingServiceThread::Run()
5) brpc/periodic_naming_service.cpp
int PeriodicNamingService::RunNamingService( const char* service_name, NamingServiceActions* actions)
根据命字服务获取ip地址列表
原文:https://www.cnblogs.com/guoliushui/p/12296687.html