{HttpServer,JsonRpc}Connection#Disconnect(): cancel I/O ops ASAP

refs #7431
This commit is contained in:
Alexander A. Klimov 2019-09-09 13:10:12 +02:00 committed by Michael Friedrich
parent b3c48e7520
commit dfaeb88ac3
2 changed files with 9 additions and 9 deletions

View File

@ -88,13 +88,13 @@ void HttpServerConnection::Disconnect()
*/
boost::system::error_code ec;
m_Stream->next_layer().async_shutdown(yc[ec]);
m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec);
m_CheckLivenessTimer.cancel();
m_Stream->lowest_layer().cancel(ec);
m_CheckLivenessTimer.cancel();
m_Stream->next_layer().async_shutdown(yc[ec]);
m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec);
auto listener (ApiListener::GetInstance());

View File

@ -224,14 +224,14 @@ void JsonRpcConnection::Disconnect()
*/
boost::system::error_code ec;
m_Stream->next_layer().async_shutdown(yc[ec]);
m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec);
m_CheckLivenessTimer.cancel();
m_HeartbeatTimer.cancel();
m_Stream->lowest_layer().cancel(ec);
m_CheckLivenessTimer.cancel();
m_HeartbeatTimer.cancel();
m_Stream->next_layer().async_shutdown(yc[ec]);
m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec);
}
});
}