progressive reconnect time

This commit is contained in:
Matias Alejo Garcia 2014-06-09 20:08:12 -03:00
commit d0e20c1bff
7 changed files with 37 additions and 18 deletions

View file

@ -126,12 +126,13 @@ Network.prototype._onClose = function(peerID) {
Network.prototype.connectToCopayers = function(copayerIds) {
var self = this;
var arrayDiff= Network._arrayDiff(copayerIds, this.connectedCopayers());
console.log('[WebRTC.js.128:arrayDiff:]',arrayDiff); //TODO
arrayDiff.forEach(function(copayerId) {
if (this.allowedCopayerIds && !this.allowedCopayerIds[copayerId]) {
this._deletePeer(this.peerFromCopayer(copayerId));
} else {
console.log('[WebRTC.js.134] CONNECT TO', copayerId); //TODO
self.connectTo(copayerId);
}
});