diff options
| author | Kevin Smith <git@kismith.co.uk> | 2015-07-23 16:33:14 (GMT) |
|---|---|---|
| committer | Kevin Smith <kevin.smith@isode.com> | 2015-08-11 09:21:19 (GMT) |
| commit | 360d7d6e0b184fea1d22ba0cc755db6f2e57e889 (patch) | |
| tree | f6ad4e6b6c1efb00e87e7f68d622aa4f5337beda | |
| parent | 32dffa31b92ad29cc15cd6e6fe3cc4ef1b4ef23a (diff) | |
| download | swift-360d7d6e0b184fea1d22ba0cc755db6f2e57e889.zip swift-360d7d6e0b184fea1d22ba0cc755db6f2e57e889.tar.bz2 | |
Add note on use of Connector::stop()
As the correct API usage might not be obvious
Change-Id: I1d4887d7101ce59eb8f3a3dc13d94befe4a58948
| -rw-r--r-- | Swiften/Network/Connector.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h index a8b0a2b..f34eaa6 100644 --- a/Swiften/Network/Connector.h +++ b/Swiften/Network/Connector.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010 Isode Limited. | 2 | * Copyright (c) 2010-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 | #pragma once | 7 | #pragma once |
| @@ -31,10 +31,15 @@ namespace Swift { | |||
| 31 | static Connector::ref create(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { | 31 | static Connector::ref create(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { |
| 32 | return ref(new Connector(hostname, port, serviceLookupPrefix, resolver, connectionFactory, timerFactory)); | 32 | return ref(new Connector(hostname, port, serviceLookupPrefix, resolver, connectionFactory, timerFactory)); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | void setTimeoutMilliseconds(int milliseconds); | 35 | void setTimeoutMilliseconds(int milliseconds); |
| 36 | /** | ||
| 37 | * Start the connection attempt. | ||
| 38 | * Note that after calling this method, the caller is responsible for calling #stop() | ||
| 39 | * if it wants to cancel it. Not doing so can leak references. | ||
| 40 | */ | ||
| 36 | void start(); | 41 | void start(); |
| 37 | void stop(); | 42 | void stop(); |
| 38 | 43 | ||
| 39 | boost::signal<void (boost::shared_ptr<Connection>, boost::shared_ptr<Error>)> onConnectFinished; | 44 | boost::signal<void (boost::shared_ptr<Connection>, boost::shared_ptr<Error>)> onConnectFinished; |
| 40 | 45 | ||
Swift