summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-03-03 11:56:45 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-04 16:01:01 (GMT)
commit4b6694377e3a0308009bdf90be0a4e0de463b215 (patch)
tree86b860395d040c38774dfa4400979f9687dff8ae /Swiften/Network/ChainedConnector.h
parentfde71bd59b1412ae475c06f2d4100ce088e86af6 (diff)
downloadswift-contrib-4b6694377e3a0308009bdf90be0a4e0de463b215.zip
swift-contrib-4b6694377e3a0308009bdf90be0a4e0de463b215.tar.bz2
Pass along errors about DNS resolution.
Diffstat (limited to 'Swiften/Network/ChainedConnector.h')
-rw-r--r--Swiften/Network/ChainedConnector.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Swiften/Network/ChainedConnector.h b/Swiften/Network/ChainedConnector.h
index 15b17f3..12ef023 100644
--- a/Swiften/Network/ChainedConnector.h
+++ b/Swiften/Network/ChainedConnector.h
@@ -6,42 +6,44 @@
#pragma once
#include <string>
#include <vector>
#include <deque>
#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
+#include <Swiften/Base/Error.h>
namespace Swift {
class Connection;
class Connector;
class ConnectionFactory;
class TimerFactory;
class DomainNameResolver;
class ChainedConnector {
public:
ChainedConnector(const std::string& hostname, DomainNameResolver*, const std::vector<ConnectionFactory*>&, TimerFactory*);
void setTimeoutMilliseconds(int milliseconds);
void start();
void stop();
- boost::signal<void (boost::shared_ptr<Connection>)> onConnectFinished;
+ boost::signal<void (boost::shared_ptr<Connection>, boost::shared_ptr<Error>)> onConnectFinished;
private:
- void finish(boost::shared_ptr<Connection> connection);
+ void finish(boost::shared_ptr<Connection> connection, boost::shared_ptr<Error>);
void tryNextConnectionFactory();
- void handleConnectorFinished(boost::shared_ptr<Connection>);
+ void handleConnectorFinished(boost::shared_ptr<Connection>, boost::shared_ptr<Error>);
private:
std::string hostname;
DomainNameResolver* resolver;
std::vector<ConnectionFactory*> connectionFactories;
TimerFactory* timerFactory;
int timeoutMilliseconds;
std::deque<ConnectionFactory*> connectionFactoryQueue;
boost::shared_ptr<Connector> currentConnector;
+ boost::shared_ptr<Error> lastError;
};
};