Connection to servers does not block the process anymore

This commit is contained in:
Florent Le Coz
2014-02-22 21:42:24 +01:00
parent 61ca40fa0e
commit 99aba5667d
10 changed files with 111 additions and 32 deletions
+7 -4
View File
@@ -29,10 +29,13 @@ void IrcClient::start()
{
this->bridge->send_xmpp_message(this->hostname, "", std::string("Connecting to ") +
this->hostname + ":" + "6667");
std::pair<bool, std::string> res = this->connect(this->hostname, "6667");
if (!res.first)
this->bridge->send_xmpp_message(this->hostname, "",
std::string("Connection failed: ") + res.second);
this->connect(this->hostname, "6667");
}
void IrcClient::on_connection_failed(const std::string& reason)
{
this->bridge->send_xmpp_message(this->hostname, "",
std::string("Connection failed: ") + reason);
}
void IrcClient::on_connected()