summaryrefslogtreecommitdiff
path: root/src/network/core/address.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/core/address.h')
-rw-r--r--src/network/core/address.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/network/core/address.h b/src/network/core/address.h
index c42805add..eea66cabb 100644
--- a/src/network/core/address.h
+++ b/src/network/core/address.h
@@ -20,6 +20,22 @@ private:
size_t address_length; ///< The length of the resolved address
sockaddr_storage address; ///< The resolved address
+ /**
+ * Helper function to resolve something to a socket.
+ * @param runp information about the socket to try not
+ * @return the opened socket or INVALID_SOCKET
+ */
+ typedef SOCKET (*LoopProc)(addrinfo *runp);
+
+ /**
+ * Resolve this address into a socket
+ * @param family the type of 'protocol' (IPv4, IPv6)
+ * @param socktype the type of socket (TCP, UDP, etc)
+ * @param flags the flags to send to getaddrinfo
+ * @param func the inner working while looping over the address info
+ * @return the resolved socket or INVALID_SOCKET.
+ */
+ SOCKET Resolve(int family, int socktype, int flags, LoopProc func);
public:
/**
* Create a network address based on a resolved IP and port