Skip to content

Commit

Permalink
call shutdown before close
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jun 26, 2019
1 parent e9fa4e9 commit 6ccef66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libi2pd/NTCP2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ namespace transport
{
m_IsTerminated = true;
m_IsEstablished = false;
boost::system::error_code ec;
m_Socket.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
if (ec)
LogPrint (eLogDebug, "NTCP2: Couldn't shutdown socket: ", ec.message ());
m_Socket.close ();
transports.PeerDisconnected (shared_from_this ());
m_Server.RemoveNTCP2Session (shared_from_this ());
Expand Down

0 comments on commit 6ccef66

Please sign in to comment.