| 47 | } |
| 48 | |
| 49 | bool AFCBusModule::LoadProcConfig() |
| 50 | { |
| 51 | AFXml xml_doc(PROC_CONFIG_FILE_PATH); |
| 52 | |
| 53 | auto root_node = xml_doc.GetRootNode(); |
| 54 | ARK_ASSERT_RET_VAL(root_node.IsValid(), false); |
| 55 | |
| 56 | for (auto proc_node = root_node.FindNode("proc"); proc_node.IsValid(); proc_node.NextNode()) |
| 57 | { |
| 58 | std::string bus_name = proc_node.GetString("busid"); |
| 59 | std::string endpoint_server = proc_node.GetString("endpoint_server"); |
| 60 | std::string endpoint_intranet = proc_node.GetString("endpoint_intranet"); |
| 61 | uint32_t max_connection = proc_node.GetUint32("max_connection"); |
| 62 | uint8_t thread_num = static_cast<uint8_t>(proc_node.GetUint32("thread_num")); |
| 63 | |
| 64 | AFBusAddr bus_addr; |
| 65 | ARK_ASSERT_CONTINUE(bus_addr.FromString(bus_name)); |
| 66 | |
| 67 | // just load self process configuration |
| 68 | if (bus_addr.bus_id != GetSelfBusID()) |
| 69 | { |
| 70 | continue; |
| 71 | } |
| 72 | |
| 73 | app_config_.self_proc.bus_id = bus_addr.bus_id; |
| 74 | app_config_.self_proc.thread_num = thread_num; |
| 75 | app_config_.self_proc.max_connection = max_connection; |
| 76 | |
| 77 | std::error_code ec; |
| 78 | app_config_.self_proc.server_ep = AFEndpoint::FromString(endpoint_server, ec); |
| 79 | app_config_.self_proc.intranet_ep = AFEndpoint::FromString(endpoint_intranet, ec); |
| 80 | |
| 81 | break; |
| 82 | } |
| 83 | |
| 84 | return true; |
| 85 | } |
| 86 | |
| 87 | bool AFCBusModule::LoadBusRelationConfig() |
| 88 | { |
nothing calls this directly
no test coverage detected