Call on_connection_failed() when the connection fails to be established
This commit is contained in:
@@ -155,6 +155,9 @@ void SocketHandler::on_recv()
|
|||||||
else if (-1 == size)
|
else if (-1 == size)
|
||||||
{
|
{
|
||||||
log_warning("Error while reading from socket: " << strerror(errno));
|
log_warning("Error while reading from socket: " << strerror(errno));
|
||||||
|
if (this->connecting)
|
||||||
|
this->on_connection_failed(strerror(errno));
|
||||||
|
else
|
||||||
this->on_connection_close();
|
this->on_connection_close();
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user