From bdc4eff1c4eef4cfe90fcf487e5ee843ea8cd31e Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 17 Jun 2013 19:45:46 +0000 Subject: [PATCH] * NTCP: Extend interval for sending time sync messages, might help expire idle conns --- .../net/i2p/router/transport/ntcp/NTCPConnection.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java index 96951cc5f..43d678cef 100644 --- a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java +++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java @@ -134,7 +134,12 @@ class NTCPConnection { */ private static final long STAT_UPDATE_TIME_MS = 30*1000; - private static final int META_FREQUENCY = 10*60*1000; + /* + * Should be longer than 2 * EventPumper.MAX_EXPIRE_IDLE_TIME so it doesn't + * interfere with the timeout, at least at first + */ + private static final int META_FREQUENCY = 45*60*1000; + /** how often we send our routerinfo unsolicited */ private static final int INFO_FREQUENCY = 90*60*1000; /** @@ -672,7 +677,7 @@ class NTCPConnection { if (_nextMetaTime <= System.currentTimeMillis()) { sendMeta(); - _nextMetaTime = System.currentTimeMillis() + (META_FREQUENCY / 2) + _context.random().nextInt(META_FREQUENCY); + _nextMetaTime = System.currentTimeMillis() + (META_FREQUENCY / 2) + _context.random().nextInt(META_FREQUENCY / 2); } OutNetMessage msg = null;