mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
call shutdown before close
This commit is contained in:
parent
e9fa4e94a6
commit
6ccef66920
@ -396,6 +396,10 @@ namespace transport
|
|||||||
{
|
{
|
||||||
m_IsTerminated = true;
|
m_IsTerminated = true;
|
||||||
m_IsEstablished = false;
|
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 ();
|
m_Socket.close ();
|
||||||
transports.PeerDisconnected (shared_from_this ());
|
transports.PeerDisconnected (shared_from_this ());
|
||||||
m_Server.RemoveNTCP2Session (shared_from_this ());
|
m_Server.RemoveNTCP2Session (shared_from_this ());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user