Call on_connection_failed() when the connection fails to be established
1 files changed, 4 insertions(+), 1 deletions(-) M src/network/socket_handler.cpp
M src/network/socket_handler.cpp => src/network/socket_handler.cpp +4 -1
@@ 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