Files
frelay/Server/main.cpp

36 lines
800 B
C++
Raw Normal View History

2025-06-20 10:33:03 +08:00
#include <QCoreApplication>
#include <Util.h>
2025-06-14 09:27:50 +08:00
#include "Server.h"
#ifndef COMPILER_USE_MINGW
#include <crashelper.h>
#endif
2025-06-14 09:27:50 +08:00
int main(int argc, char* argv[])
{
#ifndef COMPILER_USE_MINGW
2025-06-20 10:33:03 +08:00
auto configDir = Util::GetCurConfigPath("frelay");
#ifdef _WIN32
backward::SetDumpFileSavePath(configDir + "/dumpfile");
backward::SetDumpLogSavePath(configDir + "/dumplog");
#else
backward::SetDumpLogSavePath(configDir + QDir::separator() + "dumplog");
#endif
2025-06-20 10:33:03 +08:00
#endif
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;
if (!server.startServer(9009)) {
return 1;
}
qDebug() << "TCP server is running. Press Ctrl+C to exit...";
return app.exec();
}