| 49 | } |
| 50 | |
| 51 | int AFCMasterNetModule::StartServer() |
| 52 | { |
| 53 | auto ret = m_pNetServiceManagerModule->CreateServer(); |
| 54 | ret.Then([=](const std::pair<bool, std::string>& resp) { |
| 55 | if (!resp.first) |
| 56 | { |
| 57 | ARK_LOG_ERROR( |
| 58 | "Cannot start server net, busid = {}, error = {}", m_pBusModule->GetSelfBusName(), resp.second); |
| 59 | ARK_ASSERT_NO_EFFECT(0); |
| 60 | exit(0); |
| 61 | } |
| 62 | |
| 63 | m_pNetServer = m_pNetServiceManagerModule->GetSelfNetServer(); |
| 64 | if (m_pNetServer == nullptr) |
| 65 | { |
| 66 | ARK_LOG_ERROR("Cannot find server net, busid = {}", m_pBusModule->GetSelfBusName()); |
| 67 | exit(0); |
| 68 | } |
| 69 | |
| 70 | // m_pNetServer->RegMsgCallback(AFMsg::EGMI_STS_HEART_BEAT, this, &AFCMasterNetServerModule::OnHeartBeat); |
| 71 | |
| 72 | // m_pNetServer->AddEventCallBack(this, &AFCMasterNetServerModule::OnSocketEvent); |
| 73 | }); |
| 74 | |
| 75 | return 0; |
| 76 | } |
| 77 | |
| 78 | // void AFCMasterNetServerModule::OnSocketEvent(const NetEventType event, const AFGUID& conn_id, const std::string& ip, |
| 79 | // const int bus_id) |
nothing calls this directly
no test coverage detected