initialize interval and hook up listener
This commit is contained in:
@@ -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()
|
||||||
|
Reference in New Issue
Block a user