mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
postpone SAM destination termination
This commit is contained in:
parent
88594887f9
commit
47f384a0e0
@ -1161,6 +1161,15 @@ namespace client
|
|||||||
session->localDestination->Release ();
|
session->localDestination->Release ();
|
||||||
session->localDestination->StopAcceptingStreams ();
|
session->localDestination->StopAcceptingStreams ();
|
||||||
session->CloseStreams ();
|
session->CloseStreams ();
|
||||||
|
if (m_IsSingleThread)
|
||||||
|
{
|
||||||
|
auto timer = std::make_shared<boost::asio::deadline_timer>(GetService ());
|
||||||
|
timer->expires_from_now (boost::posix_time::seconds(5)); // postpone destination clean for 5 seconds
|
||||||
|
timer->async_wait ([timer, session](const boost::system::error_code& ecode)
|
||||||
|
{
|
||||||
|
// session's destructor is called here
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user