add error output on failing to accept connection

Signed-off-by: Kent Gustavsson <kent@minoris.se>
develop
Kent Gustavsson 2023-06-25 22:26:05 +02:00
parent dfd453ae05
commit ccae8bc77b
1 changed files with 6 additions and 0 deletions

@ -51,6 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "PassiveSocket.h"
#include "PluginManager.h"
#include "MiscUtils.h"
#include "Debug.h"
#include <cstdio>
#include <cstdlib>
@ -85,6 +86,7 @@ namespace {
}
namespace DFHack {
DBG_DECLARE(core, socket, DebugCategory::LINFO);
struct BlockGuard {
std::lock_guard<std::mutex> lock;
@ -484,6 +486,10 @@ void ServerMainImpl::threadFn(std::promise<bool> promise, int port)
ServerConnection::Accepted(client);
client = nullptr;
}
else
{
WARN(socket).print("Accepting connection error: %s\n", server.socket.DescribeError());
}
}
} catch(BlockedException &) {
if (client)