Skip to content

Commit

Permalink
{HttpServer,JsonRpc}Connection#Disconnect(): cancel I/O ops ASAP
Browse files Browse the repository at this point in the history
refs #7431
  • Loading branch information
Al2Klimov authored and Michael Friedrich committed Sep 9, 2019
1 parent b3c48e7 commit dfaeb88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/remote/httpserverconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
10 changes: 5 additions & 5 deletions lib/remote/jsonrpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
Expand Down

0 comments on commit dfaeb88

Please sign in to comment.