| 31 | }; |
| 32 | |
| 33 | int main(int argc, char *argv[]) |
| 34 | { |
| 35 | QApplication a(argc, argv); |
| 36 | |
| 37 | QCommandLineParser parser; |
| 38 | |
| 39 | parser.addOptions(options); |
| 40 | parser.addHelpOption(); |
| 41 | parser.process(a); |
| 42 | |
| 43 | auto list = parser.optionNames(); |
| 44 | |
| 45 | quint16 port = DefaultValues::port.toUShort(); |
| 46 | if (list.contains(OptionNames::port)) { |
| 47 | port = parser.value(OptionNames::port).toUShort(); |
| 48 | } |
| 49 | |
| 50 | jsonrpc::TcpSocketServer server("127.0.0.1", port); |
| 51 | ServerHandler hand(server, new Tools); |
| 52 | |
| 53 | if (hand.StartListening()) { |
| 54 | std::cout << "Server started successfully name: " |
| 55 | << QCoreApplication::applicationName().toStdString() |
| 56 | << "port: " << port |
| 57 | << std::endl; |
| 58 | } else { |
| 59 | std::cout << "Error starting Server name: " |
| 60 | << QCoreApplication::applicationName().toStdString() |
| 61 | << "port: " << port |
| 62 | << std::endl; |
| 63 | } |
| 64 | |
| 65 | return a.exec(); |
| 66 | } |
nothing calls this directly
no test coverage detected