summaryrefslogtreecommitdiff
path: root/src/network/core/address.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-03 09:07:16 +0000
committerrubidium <rubidium@openttd.org>2009-04-03 09:07:16 +0000
commitdccfba6e20cdc4bb6d068f075e9b6d7fefee0fb0 (patch)
tree344540fa511b17f15af59a39a41c98460ffcda9f /src/network/core/address.h
parent632d74c6b1a17f3bc3419158dfc1bb5a2e5f77b5 (diff)
downloadopenttd-dccfba6e20cdc4bb6d068f075e9b6d7fefee0fb0.tar.xz
(svn r15924) -Codechange: replace NetworkResolveHost with something less AF dependant.
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