Send the reason of the connection close to the user
This commit is contained in:
@@ -108,9 +108,16 @@ void XmppComponent::on_connected()
|
||||
this->send_pending_data();
|
||||
}
|
||||
|
||||
void XmppComponent::on_connection_close()
|
||||
void XmppComponent::on_connection_close(const std::string& error)
|
||||
{
|
||||
log_info("XMPP server closed connection");
|
||||
if (error.empty())
|
||||
{
|
||||
log_info("XMPP server closed connection");
|
||||
}
|
||||
else
|
||||
{
|
||||
log_info("XMPP server closed connection: " << error);
|
||||
}
|
||||
}
|
||||
|
||||
void XmppComponent::parse_in_buffer(const size_t size)
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
void on_connection_failed(const std::string& reason) override final;
|
||||
void on_connected() override final;
|
||||
void on_connection_close() override final;
|
||||
void on_connection_close(const std::string& error) override final;
|
||||
void parse_in_buffer(const size_t size) override final;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user