Shutdown cleanly on SIGINT

This commit is contained in:
Florent Le Coz
2014-01-04 01:59:14 +01:00
parent df59a09163
commit 3afb63a650
9 changed files with 152 additions and 29 deletions
+8
View File
@@ -21,6 +21,14 @@ Bridge::~Bridge()
{
}
void Bridge::shutdown()
{
for (auto it = this->irc_clients.begin(); it != this->irc_clients.end(); ++it)
{
it->second->send_quit_command();
}
}
Xmpp::body Bridge::make_xmpp_body(const std::string& str)
{
std::string res;
+4
View File
@@ -24,6 +24,10 @@ class Bridge
public:
explicit Bridge(const std::string& user_jid, XmppComponent* xmpp, Poller* poller);
~Bridge();
/**
* QUIT all connected IRC servers.
*/
void shutdown();
static Xmpp::body make_xmpp_body(const std::string& str);
/***