| 280 | } |
| 281 | |
| 282 | bool AFCNetServiceManagerModule::CreateClientService(const AFBusAddr& bus_addr, const std::string& ip, uint16_t port) |
| 283 | { |
| 284 | ARK_APP_TYPE app_type = ARK_APP_TYPE(bus_addr.app_type); |
| 285 | auto pClient = client_services_.find_value(app_type); |
| 286 | if (pClient == nullptr) |
| 287 | { |
| 288 | pClient = std::make_shared<AFCNetClientService>(GetPluginManager()); |
| 289 | client_services_.insert(app_type, pClient); |
| 290 | } |
| 291 | |
| 292 | AFEndpoint target_ep; |
| 293 | target_ep.SetIsV6(false); |
| 294 | target_ep.SetProtocol(proto_type::tcp); |
| 295 | target_ep.SetIP(ip); |
| 296 | target_ep.SetPort(port); |
| 297 | bool ret = pClient->StartClient(AFHeadLength::SS_HEAD_LENGTH, bus_addr.bus_id, target_ep); |
| 298 | if (!ret) |
| 299 | { |
| 300 | ARK_LOG_ERROR("start net client failed, self_bus_id={} target_url={}", m_pBusModule->GetSelfBusName(), |
| 301 | target_ep.ToString()); |
| 302 | return ret; |
| 303 | } |
| 304 | |
| 305 | ARK_LOG_INFO("start net client successful, self_bus_id={} target_url={}", m_pBusModule->GetSelfBusName(), |
| 306 | target_ep.ToString()); |
| 307 | return true; |
| 308 | } |
| 309 | |
| 310 | bool AFCNetServiceManagerModule::CheckConnectedTargetServer(const AFBusAddr& bus_addr) |
| 311 | { |
nothing calls this directly
no test coverage detected