From ccae8bc77b70f3f7862b85b37798fea2d994e150 Mon Sep 17 00:00:00 2001 From: Kent Gustavsson Date: Sun, 25 Jun 2023 22:26:05 +0200 Subject: [PATCH] add error output on failing to accept connection Signed-off-by: Kent Gustavsson --- library/RemoteServer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/RemoteServer.cpp b/library/RemoteServer.cpp index 7f40bead4..13e1d4e42 100644 --- a/library/RemoteServer.cpp +++ b/library/RemoteServer.cpp @@ -51,6 +51,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "PassiveSocket.h" #include "PluginManager.h" #include "MiscUtils.h" +#include "Debug.h" #include #include @@ -85,6 +86,7 @@ namespace { } namespace DFHack { + DBG_DECLARE(core, socket, DebugCategory::LINFO); struct BlockGuard { std::lock_guard lock; @@ -484,6 +486,10 @@ void ServerMainImpl::threadFn(std::promise promise, int port) ServerConnection::Accepted(client); client = nullptr; } + else + { + WARN(socket).print("Accepting connection error: %s\n", server.socket.DescribeError()); + } } } catch(BlockedException &) { if (client)