fix: ServerApp use the port configured by the user

This commit is contained in:
sithlord48
2025-11-05 15:22:26 -05:00
committed by Nick Bolton
parent 8ef2319b0d
commit 0a67f63af6

View File

@ -73,13 +73,16 @@ ServerApp::ServerApp(IEventQueue *events, const QString &processName) : App(even
void ServerApp::parseArgs()
{
if (const auto address = Settings::value(Settings::Core::Interface).toString(); !address.isEmpty()) {
try {
*m_deskflowAddress = NetworkAddress(address.toStdString(), kDefaultPort);
m_deskflowAddress->resolve();
} catch (SocketAddressException &e) {
LOG_CRIT("%s: %s" BYE, qPrintable(processName()), e.what(), qPrintable(processName()));
bye(s_exitArgs);
}
*m_deskflowAddress = NetworkAddress(address.toStdString(), Settings::value(Settings::Core::Port).toInt());
} else {
*m_deskflowAddress = NetworkAddress(Settings::value(Settings::Core::Port).toInt());
}
try {
m_deskflowAddress->resolve();
} catch (SocketAddressException &e) {
LOG_CRIT("%s: %s" BYE, qPrintable(processName()), e.what(), qPrintable(processName()));
bye(s_exitArgs);
}
}