diff options
Diffstat (limited to 'Swiften/Network/ChainedConnector.cpp')
| -rw-r--r-- | Swiften/Network/ChainedConnector.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Swiften/Network/ChainedConnector.cpp b/Swiften/Network/ChainedConnector.cpp index ac48d20..3cc4057 100644 --- a/Swiften/Network/ChainedConnector.cpp +++ b/Swiften/Network/ChainedConnector.cpp | |||
| @@ -1,20 +1,21 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2011 Isode Limited. | 2 | * Copyright (c) 2011-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <Swiften/Network/ChainedConnector.h> | 7 | #include <Swiften/Network/ChainedConnector.h> |
| 8 | 8 | ||
| 9 | #include <boost/bind.hpp> | ||
| 10 | #include <typeinfo> | 9 | #include <typeinfo> |
| 11 | 10 | ||
| 11 | #include <boost/bind.hpp> | ||
| 12 | |||
| 12 | #include <Swiften/Base/Log.h> | 13 | #include <Swiften/Base/Log.h> |
| 13 | #include <Swiften/Base/foreach.h> | 14 | #include <Swiften/Base/foreach.h> |
| 14 | #include <Swiften/Network/Connector.h> | ||
| 15 | #include <Swiften/Network/ConnectionFactory.h> | 15 | #include <Swiften/Network/ConnectionFactory.h> |
| 16 | #include <Swiften/Network/Connector.h> | ||
| 16 | 17 | ||
| 17 | using namespace Swift; | 18 | using namespace Swift; |
| 18 | 19 | ||
| 19 | ChainedConnector::ChainedConnector( | 20 | ChainedConnector::ChainedConnector( |
| 20 | const std::string& hostname, | 21 | const std::string& hostname, |
| @@ -30,10 +31,18 @@ ChainedConnector::ChainedConnector( | |||
| 30 | connectionFactories(connectionFactories), | 31 | connectionFactories(connectionFactories), |
| 31 | timerFactory(timerFactory), | 32 | timerFactory(timerFactory), |
| 32 | timeoutMilliseconds(0) { | 33 | timeoutMilliseconds(0) { |
| 33 | } | 34 | } |
| 34 | 35 | ||
| 36 | ChainedConnector::~ChainedConnector() { | ||
| 37 | if (currentConnector) { | ||
| 38 | currentConnector->onConnectFinished.disconnect(boost::bind(&ChainedConnector::handleConnectorFinished, this, _1, _2)); | ||
| 39 | currentConnector->stop(); | ||
| 40 | currentConnector.reset(); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 35 | void ChainedConnector::setTimeoutMilliseconds(int milliseconds) { | 44 | void ChainedConnector::setTimeoutMilliseconds(int milliseconds) { |
| 36 | timeoutMilliseconds = milliseconds; | 45 | timeoutMilliseconds = milliseconds; |
| 37 | } | 46 | } |
| 38 | 47 | ||
| 39 | void ChainedConnector::start() { | 48 | void ChainedConnector::start() { |
Swift