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

Method Start

src/plugin/net/src/AFCNetServerService.cpp:41–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39//}
40
41bool AFCNetServerService::Start(const AFHeadLength len, const int bus_id, const AFEndpoint& ep,
42 const uint8_t thread_count, const uint32_t max_connection)
43{
44 bool ret = false;
45 if (ep.proto() == proto_type::tcp)
46 {
47 m_pNet = std::make_shared<AFCTCPServer>(this, &AFCNetServerService::OnNetMsg, &AFCNetServerService::OnNetEvent);
48 ret = m_pNet->StartServer(len, bus_id, ep.GetIP(), ep.GetPort(), thread_count, max_connection, ep.IsV6());
49
50 //AFINetServerService::RegMsgCallback(
51 // AFMsg::E_SS_MSG_ID_SERVER_REPORT, this, &AFCNetServerService::OnClientRegister);
52 }
53 else if (ep.proto() == proto_type::udp)
54 {
55 // for now, do not support udp server
56 }
57 else if (ep.proto() == proto_type::ws)
58 {
59 // will add web-socket server
60 }
61 else
62 {
63 // other protocol will be supported
64 return false;
65 }
66
67 return ret;
68}
69
70bool AFCNetServerService::Update()
71{

Callers 2

CreateServerMethod · 0.45
mainFunction · 0.45

Calls 4

protoMethod · 0.80
GetPortMethod · 0.80
IsV6Method · 0.80
StartServerMethod · 0.45

Tested by

no test coverage detected