Skip to content

Commit

Permalink
Close sockets gracefully (#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptocode authored and rkeene committed Dec 14, 2018
1 parent 6854ecc commit 15c95a3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rai/node/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ void rai::socket::close ()
{
if (socket_m.is_open ())
{
try
{
socket_m.shutdown (boost::asio::ip::tcp::socket::shutdown_both);
}
catch (...)
{
/* Ignore spurious exceptions; shutdown is best effort. */
}
socket_m.close ();
}
}
Expand Down

0 comments on commit 15c95a3

Please sign in to comment.