mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-31 09:04:14 +00:00
reduced peer test interval and added peer test interval variance
This commit is contained in:
parent
c7efd465fa
commit
b8e19bf5f1
@ -1078,7 +1078,8 @@ namespace transport
|
|||||||
{
|
{
|
||||||
if (m_IsPublished)
|
if (m_IsPublished)
|
||||||
{
|
{
|
||||||
m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds(SSU2_KEEP_ALIVE_INTERVAL));
|
m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds(
|
||||||
|
SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE));
|
||||||
m_IntroducersUpdateTimer.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
m_IntroducersUpdateTimer.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
||||||
this, std::placeholders::_1, true));
|
this, std::placeholders::_1, true));
|
||||||
}
|
}
|
||||||
@ -1091,7 +1092,8 @@ namespace transport
|
|||||||
m_IntroducersUpdateTimer.cancel ();
|
m_IntroducersUpdateTimer.cancel ();
|
||||||
i2p::context.ClearSSU2Introducers (true);
|
i2p::context.ClearSSU2Introducers (true);
|
||||||
m_Introducers.clear ();
|
m_Introducers.clear ();
|
||||||
m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds(SSU2_KEEP_ALIVE_INTERVAL/2));
|
m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds(
|
||||||
|
(SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE)/2));
|
||||||
m_IntroducersUpdateTimer.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
m_IntroducersUpdateTimer.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
||||||
this, std::placeholders::_1, true));
|
this, std::placeholders::_1, true));
|
||||||
}
|
}
|
||||||
@ -1101,7 +1103,8 @@ namespace transport
|
|||||||
{
|
{
|
||||||
if (m_IsPublished)
|
if (m_IsPublished)
|
||||||
{
|
{
|
||||||
m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds(SSU2_KEEP_ALIVE_INTERVAL));
|
m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds(
|
||||||
|
SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE));
|
||||||
m_IntroducersUpdateTimerV6.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
m_IntroducersUpdateTimerV6.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
||||||
this, std::placeholders::_1, false));
|
this, std::placeholders::_1, false));
|
||||||
}
|
}
|
||||||
@ -1114,7 +1117,8 @@ namespace transport
|
|||||||
m_IntroducersUpdateTimerV6.cancel ();
|
m_IntroducersUpdateTimerV6.cancel ();
|
||||||
i2p::context.ClearSSU2Introducers (false);
|
i2p::context.ClearSSU2Introducers (false);
|
||||||
m_IntroducersV6.clear ();
|
m_IntroducersV6.clear ();
|
||||||
m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds(SSU2_KEEP_ALIVE_INTERVAL/2));
|
m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds(
|
||||||
|
(SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE)/2));
|
||||||
m_IntroducersUpdateTimerV6.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
m_IntroducersUpdateTimerV6.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
|
||||||
this, std::placeholders::_1, false));
|
this, std::placeholders::_1, false));
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,8 @@ namespace transport
|
|||||||
const size_t SSU2_MAX_NUM_INTRODUCERS = 3;
|
const size_t SSU2_MAX_NUM_INTRODUCERS = 3;
|
||||||
const int SSU2_TO_INTRODUCER_SESSION_DURATION = 3600; // 1 hour
|
const int SSU2_TO_INTRODUCER_SESSION_DURATION = 3600; // 1 hour
|
||||||
const int SSU2_TO_INTRODUCER_SESSION_EXPIRATION = 4800; // 80 minutes
|
const int SSU2_TO_INTRODUCER_SESSION_EXPIRATION = 4800; // 80 minutes
|
||||||
const int SSU2_KEEP_ALIVE_INTERVAL = 30; // in seconds
|
const int SSU2_KEEP_ALIVE_INTERVAL = 15; // in seconds
|
||||||
|
const int SSU2_KEEP_ALIVE_INTERVAL_VARIANCE = 4; // in seconds
|
||||||
const int SSU2_PROXY_CONNECT_RETRY_TIMEOUT = 30; // in seconds
|
const int SSU2_PROXY_CONNECT_RETRY_TIMEOUT = 30; // in seconds
|
||||||
|
|
||||||
class SSU2Server: private i2p::util::RunnableServiceWithWork
|
class SSU2Server: private i2p::util::RunnableServiceWithWork
|
||||||
|
Loading…
x
Reference in New Issue
Block a user