summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.hpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-12-21 21:04:41 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-01-04 01:59:14 +0100
commit3afb63a650b8b925ce1ba722dd42b7418f623713 (patch)
tree594cdfdd2a0abf302229ec000c2177ec001bfeaf /src/xmpp/xmpp_component.hpp
parentdf59a09163bd988ad4da533c4f39de057a3701ba (diff)
downloadbiboumi-3afb63a650b8b925ce1ba722dd42b7418f623713.tar.gz
biboumi-3afb63a650b8b925ce1ba722dd42b7418f623713.tar.bz2
biboumi-3afb63a650b8b925ce1ba722dd42b7418f623713.tar.xz
biboumi-3afb63a650b8b925ce1ba722dd42b7418f623713.zip
Shutdown cleanly on SIGINT
Diffstat (limited to 'src/xmpp/xmpp_component.hpp')
-rw-r--r--src/xmpp/xmpp_component.hpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_component.hpp b/src/xmpp/xmpp_component.hpp
index 1a7fc6b..1952e19 100644
--- a/src/xmpp/xmpp_component.hpp
+++ b/src/xmpp/xmpp_component.hpp
@@ -23,7 +23,14 @@ public:
void on_connected() override final;
void on_connection_close() override final;
void parse_in_buffer() override final;
-
+ /**
+ * Send a "close" message to all our connected peers. That message
+ * depends on the protocol used (this may be a QUIT irc message, or a
+ * <stream/>, etc). We may also directly close the connection, or we may
+ * wait for the remote peer to acknowledge it before closing.
+ */
+ void shutdown();
+ bool is_document_open() const;
/**
* Connect to the XMPP server.
* Returns false if we failed to connect
@@ -115,6 +122,10 @@ private:
std::string served_hostname;
std::string secret;
bool authenticated;
+ /**
+ * Whether or not OUR XMPP document is open
+ */
+ bool doc_open;
std::unordered_map<std::string, std::function<void(const Stanza&)>> stanza_handlers;