Commit baf03a7e authored by louiz’'s avatar louiz’

Do not throw an exception when recv returns and error, just close the socket

parent acf769d8
......@@ -75,7 +75,11 @@ void SocketHandler::on_recv(const size_t nb)
this->close();
}
else if (-1 == static_cast<ssize_t>(size))
throw std::runtime_error("Error reading from socket");
{
log_warning("Error while reading from socket: " << strerror(errno));
this->on_connection_close();
this->close();
}
else
{
this->in_buf += std::string(buf, size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment