log if a tcp server could not be started

This commit is contained in:
John
2023-05-18 12:03:09 +02:00
parent 1895339e45
commit 4886b016f3
+5 -1
View File
@@ -199,10 +199,14 @@ Network::Network(const bool local, const uint16_t port, const uint16_t httpPort,
if (m_tcpServer != nullptr && m_tcpServer->start() == 0) {
m_listening = true;
} else {
logError(lf_network, "unable to start TCP server on port %d: error %d", port, errno);
}
if (httpPort > 0) {
m_httpServer = new TCPServer(httpPort, "0.0.0.0");
m_httpServer->start();
if (m_httpServer->start() != 0) {
logError(lf_network, "unable to start HTTP server on port %d: error %d", httpPort, errno);
}
} else {
m_httpServer = nullptr;
}