From 05059878c78d88072cc06ac5e8ffd8cb9fe78008 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Tue, 24 Jul 2018 03:52:40 +0100 Subject: [PATCH] initialize interval and hook up listener --- .../main/groovy/com/muwire/core/hostcache/CacheClient.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy b/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy index 340e96e8..60c2f3c8 100644 --- a/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy +++ b/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy @@ -36,10 +36,12 @@ class CacheClient { this.manager = manager this.session = session this.settings = settings + this.interval = interval this.timer = new Timer("hostcache-client",true) } void start() { + session.addMuxedSessionListener(new Listener(), I2PSession.PROTO_DATAGRAM, 0) timer.schedule({queryIfNeeded()} as TimerTask, 1, interval) } @@ -173,6 +175,7 @@ class CacheClient { def pong = [:] pong.peers = neighbors pong.uuid = ping.uuid + pong.type = "CrawlerPong" pong.version = 1 pong.leafSlots = upManager.hasLeafSlots() pong.peerSlots = upManager.hasPeerSlots()