summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-12-02 20:42:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-12-03 08:09:01 (GMT)
commit5608da36a3a319070494d5a70ff984e7c172186e (patch)
tree2c44df5a9f0ea0ab180763222e54aece5dc65c93 /Swiften/Network/DomainNameServiceQuery.h
parent6e50bd41dc3f11815a40dfef500dc0d61ea5d737 (diff)
downloadswift-5608da36a3a319070494d5a70ff984e7c172186e.zip
swift-5608da36a3a319070494d5a70ff984e7c172186e.tar.bz2
DNS querying is now asynchronous.
This means we can now move them to a separate thread.
Diffstat (limited to 'Swiften/Network/DomainNameServiceQuery.h')
-rw-r--r--Swiften/Network/DomainNameServiceQuery.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Swiften/Network/DomainNameServiceQuery.h b/Swiften/Network/DomainNameServiceQuery.h
new file mode 100644
index 0000000..3c08749
--- /dev/null
+++ b/Swiften/Network/DomainNameServiceQuery.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include <boost/signals.hpp>
+#include <boost/optional.hpp>
+#include <vector>
+
+#include "Swiften/Base/String.h"
+#include "Swiften/Network/DomainNameResolveError.h"
+
+namespace Swift {
+ class DomainNameServiceQuery {
+ public:
+ struct Result {
+ Result(const String& hostname = "", int port = -1, int priority = -1, int weight = -1) : hostname(hostname), port(port), priority(priority), weight(weight) {}
+ String hostname;
+ int port;
+ int priority;
+ int weight;
+ };
+
+ virtual ~DomainNameServiceQuery();
+
+ virtual void run() = 0;
+
+ boost::signal<void (const std::vector<Result>&)> onResult;
+ };
+}