From 0825c6e8af4443f7aa5ee557f9deced4a8a538d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Ribeiro?= Date: Thu, 23 Oct 2014 20:45:17 -0200 Subject: [PATCH] peer: remove useless ping?pong! --- src/peer.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/peer.js b/src/peer.js index d947169..9f863da 100644 --- a/src/peer.js +++ b/src/peer.js @@ -20,22 +20,6 @@ class Peer extends BaseObject { this.playbackInfo = PlaybackInfo.getInstance() this.score = 1000 this.late = 0 - this.sendPing() - } - - sendPing() { - this.pingSentTime = Date.now() - this.dataChannel.send("ping$$") - } - - sendPong() { - this.dataChannel.send("pong$$" + JSON.stringify(this.playbackInfo.data)) - } - - pongReceived(content) { - this.rtt = Date.now() - this.pingSentTime - this.data = content? JSON.parse(content) : {} - log.debug(this.ident + ': ping?pong! rtt: ' + this.rtt) } sendSatisfy(resource) { @@ -82,12 +66,6 @@ class Peer extends BaseObject { case 'busy': this.swarm.busyReceived(this) break - case 'ping': - this.sendPong() - break - case 'pong': - this.pongReceived(content) - break } }