summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/Connector.h')
-rw-r--r--Swiften/Network/Connector.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h
index 6df3970..507f085 100644
--- a/Swiften/Network/Connector.h
+++ b/Swiften/Network/Connector.h
@@ -6,6 +6,7 @@
#include "Swiften/Network/DomainNameServiceQuery.h"
#include "Swiften/Network/Connection.h"
+#include "Swiften/Network/Timer.h"
#include "Swiften/Network/HostAddressPort.h"
#include "Swiften/Base/String.h"
#include "Swiften/Network/DomainNameResolveError.h"
@@ -14,10 +15,11 @@ namespace Swift {
class DomainNameAddressQuery;
class DomainNameResolver;
class ConnectionFactory;
+ class TimerFactory;
class Connector : public boost::bsignals::trackable {
public:
- Connector(const String& hostname, DomainNameResolver*, ConnectionFactory*);
+ Connector(const String& hostname, DomainNameResolver*, ConnectionFactory*, TimerFactory*);
void setTimeoutMilliseconds(int milliseconds);
void start();
@@ -33,12 +35,16 @@ namespace Swift {
void tryConnect(const HostAddressPort& target);
void handleConnectionConnectFinished(bool error);
+ void finish(boost::shared_ptr<Connection>);
+ void handleTimeout();
private:
String hostname;
DomainNameResolver* resolver;
ConnectionFactory* connectionFactory;
+ TimerFactory* timerFactory;
int timeoutMilliseconds;
+ boost::shared_ptr<Timer> timer;
boost::shared_ptr<DomainNameServiceQuery> serviceQuery;
std::deque<DomainNameServiceQuery::Result> serviceQueryResults;
boost::shared_ptr<DomainNameAddressQuery> addressQuery;