Call on_connection_failed() when the connection fails to be established

This commit is contained in:
Florent Le Coz
2014-04-15 06:47:38 +02:00
parent f7b75d7eb4
commit 58a2c00d44
+4 -1
View File
@@ -155,7 +155,10 @@ void SocketHandler::on_recv()
else if (-1 == size)
{
log_warning("Error while reading from socket: " << strerror(errno));
this->on_connection_close();
if (this->connecting)
this->on_connection_failed(strerror(errno));
else
this->on_connection_close();
this->close();
}
else