mirror of https://github.com/zlatinb/muwire
initialize interval and hook up listener
parent
46ddd65e03
commit
05059878c7
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue