| 39 | //} |
| 40 | |
| 41 | bool 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 | |
| 70 | bool AFCNetServerService::Update() |
| 71 | { |
no test coverage detected