Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
peer: remove useless ping?pong!
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioribeiro committed Oct 23, 2014
1 parent 2407cdf commit 0825c6e
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}
}

Expand Down

0 comments on commit 0825c6e

Please sign in to comment.