Files

34 lines
747 B
C++
Raw Permalink Normal View History

2025-06-20 10:33:03 +08:00
#include <QCoreApplication>
2025-06-29 17:05:31 +08:00
#include <QDir>
2025-06-20 10:33:03 +08:00
#include <Util.h>
2025-10-20 15:22:38 +08:00
#include <fversion.h>
#include <iostream>
2025-06-14 09:27:50 +08:00
#include "Server.h"
int main(int argc, char* argv[])
{
2025-10-23 09:46:54 +08:00
auto ver = Util::GetVersion();
std::cout << "==============> " << ver.toStdString() << std::endl;
2025-10-20 15:22:38 +08:00
2025-06-29 22:13:42 +08:00
int port = 9009;
if (argc < 2) {
qInfo() << "==============> Usage: frelayServer port.";
2025-06-29 22:13:42 +08:00
} else {
port = atoi(argv[1]);
}
2025-06-14 09:27:50 +08:00
QCoreApplication app(argc, argv);
Util::InitLogger("frelayServer.log", "frelayServer");
qInstallMessageHandler(Util::ConsoleMsgHander);
2025-06-14 09:27:50 +08:00
Server server;
2025-06-29 22:13:42 +08:00
if (!server.startServer(port)) {
2025-06-14 09:27:50 +08:00
return 1;
}
qInfo() << "TCP server is running. Press Ctrl+C to exit...";
2025-06-14 09:27:50 +08:00
return app.exec();
}