increase default session lifetime to 5 minutes for mobile client related reasons

make the default inbound session lifetime be default session lifetime + 2 ping intervals
This commit is contained in:
Jeff Becker 2021-06-03 13:33:00 -04:00
parent a7b20b79c5
commit 60cc47447f
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 2 additions and 2 deletions

View File

@ -5,6 +5,6 @@
#include <cstdlib>
constexpr size_t MAX_LINK_MSG_SIZE = 8192;
static constexpr auto DefaultLinkSessionLifetime = 1min;
static constexpr auto DefaultLinkSessionLifetime = 5min;
constexpr size_t MaxSendQueueSize = 1024 * 16;
static constexpr auto LinkLayerConnectTimeout = 5s;

View File

@ -34,7 +34,7 @@ namespace llarp
/// How often we send a keepalive
static constexpr std::chrono::milliseconds PingInterval = 5s;
/// How long we wait for a session to die with no tx from them
static constexpr auto SessionAliveTimeout = PingInterval * 5;
static constexpr auto SessionAliveTimeout = (PingInterval * 2) + DefaultLinkSessionLifetime;
struct Session : public ILinkSession, public std::enable_shared_from_this<Session>
{