mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
termination check timeout variance
This commit is contained in:
parent
66223792f3
commit
da0e527777
@ -1642,7 +1642,8 @@ namespace transport
|
|||||||
|
|
||||||
void NTCP2Server::ScheduleTermination ()
|
void NTCP2Server::ScheduleTermination ()
|
||||||
{
|
{
|
||||||
m_TerminationTimer.expires_from_now (boost::posix_time::seconds(NTCP2_TERMINATION_CHECK_TIMEOUT));
|
m_TerminationTimer.expires_from_now (boost::posix_time::seconds(
|
||||||
|
NTCP2_TERMINATION_CHECK_TIMEOUT + m_Rng () % NTCP2_TERMINATION_CHECK_TIMEOUT_VARIANCE));
|
||||||
m_TerminationTimer.async_wait (std::bind (&NTCP2Server::HandleTerminationTimer,
|
m_TerminationTimer.async_wait (std::bind (&NTCP2Server::HandleTerminationTimer,
|
||||||
this, std::placeholders::_1));
|
this, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,8 @@ namespace transport
|
|||||||
const int NTCP2_ESTABLISH_TIMEOUT = 10; // 10 seconds
|
const int NTCP2_ESTABLISH_TIMEOUT = 10; // 10 seconds
|
||||||
const int NTCP2_TERMINATION_TIMEOUT = 115; // 2 minutes - 5 seconds
|
const int NTCP2_TERMINATION_TIMEOUT = 115; // 2 minutes - 5 seconds
|
||||||
const int NTCP2_TERMINATION_TIMEOUT_VARIANCE = 10; // 10 seconds
|
const int NTCP2_TERMINATION_TIMEOUT_VARIANCE = 10; // 10 seconds
|
||||||
const int NTCP2_TERMINATION_CHECK_TIMEOUT = 30; // 30 seconds
|
const int NTCP2_TERMINATION_CHECK_TIMEOUT = 28; // 28 seconds
|
||||||
|
const int NTCP2_TERMINATION_CHECK_TIMEOUT_VARIANCE = 5; // 5 seconds
|
||||||
const int NTCP2_RECEIVE_BUFFER_DELETION_TIMEOUT = 3; // 3 seconds
|
const int NTCP2_RECEIVE_BUFFER_DELETION_TIMEOUT = 3; // 3 seconds
|
||||||
const int NTCP2_ROUTERINFO_RESEND_INTERVAL = 25*60; // 25 minuntes in seconds
|
const int NTCP2_ROUTERINFO_RESEND_INTERVAL = 25*60; // 25 minuntes in seconds
|
||||||
const int NTCP2_ROUTERINFO_RESEND_INTERVAL_THRESHOLD = 25*60; // 25 minuntes
|
const int NTCP2_ROUTERINFO_RESEND_INTERVAL_THRESHOLD = 25*60; // 25 minuntes
|
||||||
|
@ -914,7 +914,8 @@ namespace transport
|
|||||||
|
|
||||||
void SSU2Server::ScheduleTermination ()
|
void SSU2Server::ScheduleTermination ()
|
||||||
{
|
{
|
||||||
m_TerminationTimer.expires_from_now (boost::posix_time::seconds(SSU2_TERMINATION_CHECK_TIMEOUT));
|
m_TerminationTimer.expires_from_now (boost::posix_time::seconds(
|
||||||
|
SSU2_TERMINATION_CHECK_TIMEOUT + m_Rng () % SSU2_TERMINATION_CHECK_TIMEOUT_VARIANCE));
|
||||||
m_TerminationTimer.async_wait (std::bind (&SSU2Server::HandleTerminationTimer,
|
m_TerminationTimer.async_wait (std::bind (&SSU2Server::HandleTerminationTimer,
|
||||||
this, std::placeholders::_1));
|
this, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,8 @@ namespace i2p
|
|||||||
{
|
{
|
||||||
namespace transport
|
namespace transport
|
||||||
{
|
{
|
||||||
const int SSU2_TERMINATION_CHECK_TIMEOUT = 25; // in seconds
|
const int SSU2_TERMINATION_CHECK_TIMEOUT = 23; // in seconds
|
||||||
|
const int SSU2_TERMINATION_CHECK_TIMEOUT_VARIANCE = 5; // in seconds
|
||||||
const int SSU2_CLEANUP_INTERVAL = 72; // in seconds
|
const int SSU2_CLEANUP_INTERVAL = 72; // in seconds
|
||||||
const int SSU2_RESEND_CHECK_TIMEOUT = 40; // in milliseconds
|
const int SSU2_RESEND_CHECK_TIMEOUT = 40; // in milliseconds
|
||||||
const int SSU2_RESEND_CHECK_TIMEOUT_VARIANCE = 10; // in milliseconds
|
const int SSU2_RESEND_CHECK_TIMEOUT_VARIANCE = 10; // in milliseconds
|
||||||
|
Loading…
Reference in New Issue
Block a user