In AutoSocket::async_shutdown, pass the error code to the handler, don't throw it.

This commit is contained in:
JoelKatz
2013-06-15 01:41:18 -07:00
parent bf60efcef2
commit 91a6f964af

View File

@@ -107,8 +107,16 @@ public:
mSocket->async_shutdown(handler);
else
{
lowest_layer().shutdown(plain_socket::shutdown_both);
mSocket->get_io_service().post(boost::bind(handler, error_code()));
error_code ec;
try
{
lowest_layer().shutdown(plain_socket::shutdown_both);
}
catch (boost::system::system_error& e)
{
ec = e.code();
}
mSocket->get_io_service().post(boost::bind(handler, ec));
}
}