MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / main

Function main

CodeFormatServer/src/main.cpp:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16using namespace asio::ip;
17
18int main(int argc, char **argv) {
19 LanguageServer server;
20 auto &ioc = server.GetIOContext();
21 if (argc > 1) {
22 int port = std::stoi(argv[1]);
23 tcp::acceptor acceptor(ioc, tcp::endpoint(tcp::v4(), port));
24
25 auto socket = acceptor.accept();
26 server.SetSession(std::make_shared<SocketIOSession>(std::move(socket)));
27 } else {
28 SET_BINARY_MODE();
29 server.SetSession(std::make_shared<StandardIOSession>());
30 }
31
32 return server.Run();
33}

Callers

nothing calls this directly

Calls 4

SetSessionMethod · 0.80
endpointFunction · 0.50
acceptMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected