log socket error messages

This commit is contained in:
badaix 2015-12-22 13:13:58 +01:00
parent b4a23894f0
commit 7e1a8279df
2 changed files with 4 additions and 4 deletions

View file

@ -87,9 +87,9 @@ void ClientConnection::stop()
if (socket_)
{
socket_->shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
if (ec) logE << "Error in socket shutdown: " << ec << endl;
if (ec) logE << "Error in socket shutdown: " << ec.message() << endl;
socket_->close(ec);
if (ec) logE << "Error in socket close: " << ec << endl;
if (ec) logE << "Error in socket close: " << ec.message() << endl;
}
if (readerThread_)
{

View file

@ -58,9 +58,9 @@ void ServerSession::stop()
if (socket_)
{
socket_->shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
if (ec) logE << "Error in socket shutdown: " << ec << "\n";
if (ec) logE << "Error in socket shutdown: " << ec.message() << "\n";
socket_->close(ec);
if (ec) logE << "Error in socket close: " << ec << "\n";
if (ec) logE << "Error in socket close: " << ec.message() << "\n";
}
if (readerThread_)
{