summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/SluiftComponent.cpp')
-rw-r--r--Sluift/SluiftComponent.cpp5
1 files changed, 4 insertions, 1 deletions
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
43void SluiftComponent::connect(const std::string& host, int port) { 43void 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}