diff options
Diffstat (limited to 'Swiften/Component')
| -rw-r--r-- | Swiften/Component/ComponentConnector.cpp | 4 | ||||
| -rw-r--r-- | Swiften/Component/ComponentConnector.h | 8 | ||||
| -rw-r--r-- | Swiften/Component/CoreComponent.cpp | 2 | ||||
| -rw-r--r-- | Swiften/Component/CoreComponent.h | 2 | ||||
| -rw-r--r-- | Swiften/Component/UnitTest/ComponentConnectorTest.cpp | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/Swiften/Component/ComponentConnector.cpp b/Swiften/Component/ComponentConnector.cpp index a7375a7..7789c4c 100644 --- a/Swiften/Component/ComponentConnector.cpp +++ b/Swiften/Component/ComponentConnector.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2016 Isode Limited. | 2 | * Copyright (c) 2010-2018 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 | */ |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | namespace Swift { | 16 | namespace Swift { |
| 17 | 17 | ||
| 18 | ComponentConnector::ComponentConnector(const std::string& hostname, int port, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) : hostname(hostname), port(port), resolver(resolver), connectionFactory(connectionFactory), timerFactory(timerFactory), timeoutMilliseconds(0) { | 18 | ComponentConnector::ComponentConnector(const std::string& hostname, unsigned short port, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) : hostname(hostname), port(port), resolver(resolver), connectionFactory(connectionFactory), timerFactory(timerFactory), timeoutMilliseconds(0) { |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void ComponentConnector::setTimeoutMilliseconds(int milliseconds) { | 21 | void ComponentConnector::setTimeoutMilliseconds(int milliseconds) { |
diff --git a/Swiften/Component/ComponentConnector.h b/Swiften/Component/ComponentConnector.h index ab36901..cfd49fe 100644 --- a/Swiften/Component/ComponentConnector.h +++ b/Swiften/Component/ComponentConnector.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2016 Isode Limited. | 2 | * Copyright (c) 2010-2018 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 | */ |
| @@ -28,7 +28,7 @@ namespace Swift { | |||
| 28 | public: | 28 | public: |
| 29 | typedef std::shared_ptr<ComponentConnector> ref; | 29 | typedef std::shared_ptr<ComponentConnector> ref; |
| 30 | 30 | ||
| 31 | static ComponentConnector::ref create(const std::string& hostname, int port, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { | 31 | static ComponentConnector::ref create(const std::string& hostname, unsigned short port, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { |
| 32 | return ref(new ComponentConnector(hostname, port, resolver, connectionFactory, timerFactory)); | 32 | return ref(new ComponentConnector(hostname, port, resolver, connectionFactory, timerFactory)); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| @@ -40,7 +40,7 @@ namespace Swift { | |||
| 40 | boost::signals2::signal<void (std::shared_ptr<Connection>)> onConnectFinished; | 40 | boost::signals2::signal<void (std::shared_ptr<Connection>)> onConnectFinished; |
| 41 | 41 | ||
| 42 | private: | 42 | private: |
| 43 | ComponentConnector(const std::string& hostname, int port, DomainNameResolver*, ConnectionFactory*, TimerFactory*); | 43 | ComponentConnector(const std::string& hostname, unsigned short port, DomainNameResolver*, ConnectionFactory*, TimerFactory*); |
| 44 | 44 | ||
| 45 | void handleAddressQueryResult(const std::vector<HostAddress>& address, boost::optional<DomainNameResolveError> error); | 45 | void handleAddressQueryResult(const std::vector<HostAddress>& address, boost::optional<DomainNameResolveError> error); |
| 46 | void tryNextAddress(); | 46 | void tryNextAddress(); |
| @@ -53,7 +53,7 @@ namespace Swift { | |||
| 53 | 53 | ||
| 54 | private: | 54 | private: |
| 55 | std::string hostname; | 55 | std::string hostname; |
| 56 | int port; | 56 | unsigned short port; |
| 57 | DomainNameResolver* resolver; | 57 | DomainNameResolver* resolver; |
| 58 | ConnectionFactory* connectionFactory; | 58 | ConnectionFactory* connectionFactory; |
| 59 | TimerFactory* timerFactory; | 59 | TimerFactory* timerFactory; |
diff --git a/Swiften/Component/CoreComponent.cpp b/Swiften/Component/CoreComponent.cpp index 5b2277b..2d91c9c 100644 --- a/Swiften/Component/CoreComponent.cpp +++ b/Swiften/Component/CoreComponent.cpp | |||
| @@ -43,7 +43,7 @@ CoreComponent::~CoreComponent() { | |||
| 43 | delete stanzaChannel_; | 43 | delete stanzaChannel_; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | void CoreComponent::connect(const std::string& host, int port) { | 46 | void CoreComponent::connect(const std::string& host, unsigned short port) { |
| 47 | assert(!connector_); | 47 | assert(!connector_); |
| 48 | connector_ = ComponentConnector::create(host, port, networkFactories->getDomainNameResolver(), networkFactories->getConnectionFactory(), networkFactories->getTimerFactory()); | 48 | connector_ = ComponentConnector::create(host, port, networkFactories->getDomainNameResolver(), networkFactories->getConnectionFactory(), networkFactories->getTimerFactory()); |
| 49 | connector_->onConnectFinished.connect(boost::bind(&CoreComponent::handleConnectorFinished, this, _1)); | 49 | connector_->onConnectFinished.connect(boost::bind(&CoreComponent::handleConnectorFinished, this, _1)); |
diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h index 1a487d2..7565d00 100644 --- a/Swiften/Component/CoreComponent.h +++ b/Swiften/Component/CoreComponent.h | |||
| @@ -46,7 +46,7 @@ namespace Swift { | |||
| 46 | CoreComponent(const JID& jid, const std::string& secret, NetworkFactories* networkFactories); | 46 | CoreComponent(const JID& jid, const std::string& secret, NetworkFactories* networkFactories); |
| 47 | virtual ~CoreComponent(); | 47 | virtual ~CoreComponent(); |
| 48 | 48 | ||
| 49 | void connect(const std::string& host, int port); | 49 | void connect(const std::string& host, unsigned short port); |
| 50 | void disconnect(); | 50 | void disconnect(); |
| 51 | 51 | ||
| 52 | void sendMessage(std::shared_ptr<Message>); | 52 | void sendMessage(std::shared_ptr<Message>); |
diff --git a/Swiften/Component/UnitTest/ComponentConnectorTest.cpp b/Swiften/Component/UnitTest/ComponentConnectorTest.cpp index 3b4fa83..bd26989 100644 --- a/Swiften/Component/UnitTest/ComponentConnectorTest.cpp +++ b/Swiften/Component/UnitTest/ComponentConnectorTest.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2016 Isode Limited. | 2 | * Copyright (c) 2010-2018 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 | */ |
| @@ -146,7 +146,7 @@ class ComponentConnectorTest : public CppUnit::TestFixture { | |||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | private: | 148 | private: |
| 149 | ComponentConnector::ref createConnector(const std::string& hostname, int port) { | 149 | ComponentConnector::ref createConnector(const std::string& hostname, unsigned short port) { |
| 150 | ComponentConnector::ref connector = ComponentConnector::create(hostname, port, resolver, connectionFactory, timerFactory); | 150 | ComponentConnector::ref connector = ComponentConnector::create(hostname, port, resolver, connectionFactory, timerFactory); |
| 151 | connector->onConnectFinished.connect(boost::bind(&ComponentConnectorTest::handleConnectorFinished, this, _1)); | 151 | connector->onConnectFinished.connect(boost::bind(&ComponentConnectorTest::handleConnectorFinished, this, _1)); |
| 152 | return connector; | 152 | return connector; |
Swift