summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/HostnameLookup.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-01-18 11:57:16 +0100
committerMattes D <github@xoft.cz>2015-01-22 20:13:02 +0100
commitc0cb787c101725a649d26de68fca2632c82830ba (patch)
treec5efafa98e7ccfa628f5873e5611b49ff0b44d21 /src/OSSupport/HostnameLookup.h
parentcNetwork: Fixed WinXP dualstack listening. (diff)
downloadcuberite-c0cb787c101725a649d26de68fca2632c82830ba.tar
cuberite-c0cb787c101725a649d26de68fca2632c82830ba.tar.gz
cuberite-c0cb787c101725a649d26de68fca2632c82830ba.tar.bz2
cuberite-c0cb787c101725a649d26de68fca2632c82830ba.tar.lz
cuberite-c0cb787c101725a649d26de68fca2632c82830ba.tar.xz
cuberite-c0cb787c101725a649d26de68fca2632c82830ba.tar.zst
cuberite-c0cb787c101725a649d26de68fca2632c82830ba.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/HostnameLookup.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/OSSupport/HostnameLookup.h b/src/OSSupport/HostnameLookup.h
new file mode 100644
index 000000000..98f48b933
--- /dev/null
+++ b/src/OSSupport/HostnameLookup.h
@@ -0,0 +1,41 @@
+
+// HostnameLookup.h
+
+// Declares the cHostnameLookup class representing an in-progress hostname-to-IP lookup
+
+// This is an internal header, no-one outside OSSupport should need to include it; use Network.h instead
+
+
+
+
+
+#pragma once
+
+#include "Network.h"
+#include <event2/util.h>
+
+
+
+
+
+/** Holds information about an in-progress Hostname-to-IP lookup. */
+class cHostnameLookup
+{
+ /** The callbacks to call for resolved names / errors. */
+ cNetwork::cResolveNameCallbacksPtr m_Callbacks;
+
+ /** The hostname that was queried (needed for the callbacks). */
+ AString m_Hostname;
+
+ static void Callback(int a_ErrCode, struct evutil_addrinfo * a_Addr, void * a_Self);
+
+public:
+ cHostnameLookup(const AString & a_Hostname, cNetwork::cResolveNameCallbacksPtr a_Callbacks);
+};
+typedef SharedPtr<cHostnameLookup> cHostnameLookupPtr;
+typedef std::vector<cHostnameLookupPtr> cHostnameLookupPtrs;
+
+
+
+
+