summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-02-22 21:42:24 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-02-22 21:42:24 +0100
commit99aba5667d0d7ba6657f9c175a9342126bc4b0f2 (patch)
tree2448f73a7e4129f1a8f9f51e230dd00111452a30 /src/xmpp/xmpp_component.cpp
parent61ca40fa0e6c819aa72f3f2364667c7b990855d4 (diff)
downloadbiboumi-99aba5667d0d7ba6657f9c175a9342126bc4b0f2.tar.gz
biboumi-99aba5667d0d7ba6657f9c175a9342126bc4b0f2.tar.bz2
biboumi-99aba5667d0d7ba6657f9c175a9342126bc4b0f2.tar.xz
biboumi-99aba5667d0d7ba6657f9c175a9342126bc4b0f2.zip
Connection to servers does not block the process anymore
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index e059764..c39585d 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -50,9 +50,9 @@ XmppComponent::~XmppComponent()
{
}
-bool XmppComponent::start()
+void XmppComponent::start()
{
- return this->connect("127.0.0.1", "5347").first;
+ this->connect("127.0.0.1", "5347");
}
bool XmppComponent::is_document_open() const
@@ -67,6 +67,11 @@ void XmppComponent::send_stanza(const Stanza& stanza)
this->send_data(std::move(str));
}
+void XmppComponent::on_connection_failed(const std::string& reason)
+{
+ log_error("Failed to connect to the XMPP server: " << reason);
+}
+
void XmppComponent::on_connected()
{
log_info("connected to XMPP server");
@@ -103,7 +108,7 @@ void XmppComponent::clean()
while (it != this->bridges.end())
{
it->second->clean();
- if (it->second->connected_clients() == 0)
+ if (it->second->active_clients() == 0)
it = this->bridges.erase(it);
else
++it;