MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / StartServer

Method StartServer

src/server/master/src/AFCMasterNetModule.cpp:51–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51int 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)

Callers

nothing calls this directly

Calls 4

CreateServerMethod · 0.80
ThenMethod · 0.80
GetSelfBusNameMethod · 0.80
GetSelfNetServerMethod · 0.80

Tested by

no test coverage detected