summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-12-11 12:31:21 +0000
committerPeter Powell <petpow@saberuk.com>2019-12-12 14:37:38 +0000
commitce7979bd7d6278bc1b67cf46a73a3d23e02a6ae5 (patch)
treeb0e8ac9caac91b330e65981f6be4df7642eba916 /include
parenta1c127aef6e1833cb480a8f37f75029c46256661 (diff)
Extract port binding code to a function and improve output.
Diffstat (limited to 'include')
-rw-r--r--include/socket.h24
1 files changed, 23 insertions, 1 deletions
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<std::pair<irc::sockets::sockaddrs, int> > FailedPortList;
+typedef std::vector<FailedPort> 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.