diff options
Diffstat (limited to 'Swiften/Component/CoreComponent.h')
-rw-r--r-- | Swiften/Component/CoreComponent.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h index 669be97..7565d00 100644 --- a/Swiften/Component/CoreComponent.h +++ b/Swiften/Component/CoreComponent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -26,11 +26,10 @@ #include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h> namespace Swift { - class EventLoop; + class BasicSessionStream; + class ComponentSession; class IQRouter; class NetworkFactories; - class ComponentSession; - class BasicSessionStream; /** * The central class for communicating with an XMPP server as a component. @@ -47,7 +46,7 @@ namespace Swift { CoreComponent(const JID& jid, const std::string& secret, NetworkFactories* networkFactories); virtual ~CoreComponent(); - void connect(const std::string& host, int port); + void connect(const std::string& host, unsigned short port); void disconnect(); void sendMessage(std::shared_ptr<Message>); @@ -62,9 +61,18 @@ namespace Swift { return stanzaChannel_; } - bool isAvailable() const { - return stanzaChannel_->isAvailable(); - } + /** + * Checks whether the component is connected to the server, + * and stanzas can be sent. + */ + bool isAvailable() const; + + /** + * Checks whether the component is active. + * + * A component is active when it is connected or connecting to the server. + */ + bool isActive() const; /** * Returns the JID of the component |