From 4886b016f31995dcf60a9be44921c29f522df52b Mon Sep 17 00:00:00 2001 From: John Date: Thu, 18 May 2023 12:03:09 +0200 Subject: [PATCH] log if a tcp server could not be started --- src/ebusd/network.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ebusd/network.cpp b/src/ebusd/network.cpp index 6bc27bd0..0a51f2fc 100644 --- a/src/ebusd/network.cpp +++ b/src/ebusd/network.cpp @@ -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; }