mirror of https://github.com/zlatinb/muwire
start connection manager, fix some issues
parent
4e31f216a8
commit
a004bd430a
|
@ -88,6 +88,7 @@ class Core {
|
|||
new LeafConnectionManager(eventBus,3, hostCache) : new UltrapeerConnectionManager(eventBus, 512, 512, hostCache)
|
||||
eventBus.register(TrustEvent.class, connectionManager)
|
||||
eventBus.register(ConnectionEvent.class, connectionManager)
|
||||
connectionManager.start()
|
||||
|
||||
log.info("initializing cache client")
|
||||
CacheClient cacheClient = new CacheClient(eventBus,hostCache, connectionManager, i2pSession, props, 10000)
|
||||
|
|
|
@ -53,7 +53,7 @@ abstract class ConnectionManager {
|
|||
|
||||
abstract void onConnectionEvent(ConnectionEvent e)
|
||||
|
||||
private void sendPings() {
|
||||
protected void sendPings() {
|
||||
final long now = System.currentTimeMillis()
|
||||
getConnections().each {
|
||||
if (now - it.lastPingSentTime > PING_TIME)
|
||||
|
|
|
@ -63,7 +63,7 @@ class PeerConnection extends Connection {
|
|||
byte [] payload
|
||||
if (message instanceof Map) {
|
||||
payload = JsonOutput.toJson(message)
|
||||
DataUtil.packHeader(payload.bytes.length, writeHeader)
|
||||
DataUtil.packHeader(payload.length, writeHeader)
|
||||
writeHeader[0] &= 0x7F
|
||||
} else {
|
||||
// TODO: write binary
|
||||
|
|
Loading…
Reference in New Issue