From ce7979bd7d6278bc1b67cf46a73a3d23e02a6ae5 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 11 Dec 2019 12:31:21 +0000 Subject: Extract port binding code to a function and improve output. --- include/socket.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/socket.h b/include/socket.h index 6ecb23020..36f020b25 100644 --- a/include/socket.h +++ b/include/socket.h @@ -136,10 +136,32 @@ namespace irc } } +/** Represents information about a failed port binding. */ +struct CoreExport FailedPort +{ + + /** The error which happened during binding. */ + int error; + + /** The endpoint on which we were attempting to bind. */ + irc::sockets::sockaddrs sa; + + /** The config tag that the listener was created from. */ + ConfigTag* tag; + + FailedPort(int err, irc::sockets::sockaddrs& ep, ConfigTag* cfg) + : error(err) + , sa(ep) + , tag(cfg) + { + } +}; + /** A list of failed port bindings, used for informational purposes on startup */ -typedef std::vector > FailedPortList; +typedef std::vector FailedPortList; #include "socketengine.h" + /** This class handles incoming connections on client ports. * It will create a new User for every valid connection * and assign it a file descriptor. -- cgit v1.2.3