| 16 | using namespace asio::ip; |
| 17 | |
| 18 | int 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 | } |
nothing calls this directly
no test coverage detected