initialize interval and hook up listener

pull/4/head
Zlatin Balevsky 2018-07-24 03:52:40 +01:00
parent 46ddd65e03
commit 05059878c7
1 changed files with 3 additions and 0 deletions

View File

@ -36,10 +36,12 @@ class CacheClient {
this.manager = manager this.manager = manager
this.session = session this.session = session
this.settings = settings this.settings = settings
this.interval = interval
this.timer = new Timer("hostcache-client",true) this.timer = new Timer("hostcache-client",true)
} }
void start() { void start() {
session.addMuxedSessionListener(new Listener(), I2PSession.PROTO_DATAGRAM, 0)
timer.schedule({queryIfNeeded()} as TimerTask, 1, interval) timer.schedule({queryIfNeeded()} as TimerTask, 1, interval)
} }
@ -173,6 +175,7 @@ class CacheClient {
def pong = [:] def pong = [:]
pong.peers = neighbors pong.peers = neighbors
pong.uuid = ping.uuid pong.uuid = ping.uuid
pong.type = "CrawlerPong"
pong.version = 1 pong.version = 1
pong.leafSlots = upManager.hasLeafSlots() pong.leafSlots = upManager.hasLeafSlots()
pong.peerSlots = upManager.hasPeerSlots() pong.peerSlots = upManager.hasPeerSlots()