diff options
Diffstat (limited to 'Sluift')
| -rw-r--r-- | Sluift/SluiftClient.cpp | 5 | ||||
| -rw-r--r-- | Sluift/SluiftComponent.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Sluift/SluiftClient.cpp b/Sluift/SluiftClient.cpp index e8c43c9..5243ed0 100644 --- a/Sluift/SluiftClient.cpp +++ b/Sluift/SluiftClient.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2013-2017 Isode Limited. | 2 | * Copyright (c) 2013-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 | */ |
| @@ -48,6 +48,9 @@ SluiftClient::~SluiftClient() { | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | void SluiftClient::connect() { | 50 | void SluiftClient::connect() { |
| 51 | if (client->isActive()) { | ||
| 52 | throw Lua::Exception("Client is already connecting or connected"); | ||
| 53 | } | ||
| 51 | rosterReceived = false; | 54 | rosterReceived = false; |
| 52 | blockListReceived = false; | 55 | blockListReceived = false; |
| 53 | disconnectedError = boost::optional<ClientError>(); | 56 | disconnectedError = boost::optional<ClientError>(); |
diff --git a/Sluift/SluiftComponent.cpp b/Sluift/SluiftComponent.cpp index e1d1738..126562e 100644 --- a/Sluift/SluiftComponent.cpp +++ b/Sluift/SluiftComponent.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2014-2016 Isode Limited. | 2 | * Copyright (c) 2014-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 | */ |
| @@ -41,6 +41,9 @@ SluiftComponent::~SluiftComponent() { | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void SluiftComponent::connect(const std::string& host, int port) { | 43 | void SluiftComponent::connect(const std::string& host, int port) { |
| 44 | if (component->isActive()) { | ||
| 45 | throw Lua::Exception("Component is already connecting or connected"); | ||
| 46 | } | ||
| 44 | disconnectedError = boost::optional<ComponentError>(); | 47 | disconnectedError = boost::optional<ComponentError>(); |
| 45 | component->connect(host, port); | 48 | component->connect(host, port); |
| 46 | } | 49 | } |
Swift