My code is as follows:
declaration: boost::asio::ssl::stream<boost::asio::ip::tcp::socket> m_remote_socket;
m_remote_socket.shutdown(ec);
if (ec)
{
cdbug<<"id: "<<m_id<<", error when ssl shutdown: " <<boost::system::system_category().message(ec.value()).c_str();
}
m_remote_socket.lowest_layer().shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
if (ec)
{
cdbug<<"id: "<<m_id<<", error when tcp shutdown: "<<boost::system::system_category().message(ec.value()).c_str();
}
Each time I call m_remote_socket.shutdown
, it will get an error. Such kind of unknown error with a really big error value.
But it is ok to call m_remote_socket.lowest_layer().shutdown()
directly without calling m_remote_socket.shutdown
.
Could anybody tell me how to close a ssl streaming socket?