This commit is contained in:
Michelle Bu 2013-02-05 02:14:45 -08:00
parent f60bfa8a96
commit 67f623f68b

View File

@ -234,8 +234,6 @@ PeerServer.prototype._handleTransmission = function(message, res) {
} else { } else {
destination.send(data); destination.send(data);
} }
// We have to let the source peer know that the offer was sent
// successfully so that ice can start being processed.
if (!!res) { if (!!res) {
res.send(200); res.send(200);
} }
@ -253,8 +251,9 @@ PeerServer.prototype._handleTransmission = function(message, res) {
if (!!res) res.send(501); if (!!res) res.send(501);
} }
} else { } else {
// Wait 5 seconds for this client to connect/reconnect (XHR) for important
// messages.
if (type !== 'LEAVE') { if (type !== 'LEAVE') {
// Wait 5 seconds for this client to connect.
var self = this; var self = this;
if (!this._outstandingOffers[dst]) if (!this._outstandingOffers[dst])
this._outstandingOffers[dst] = {}; this._outstandingOffers[dst] = {};
@ -262,7 +261,7 @@ PeerServer.prototype._handleTransmission = function(message, res) {
this._outstandingOffers[dst][src] = []; this._outstandingOffers[dst][src] = [];
setTimeout(function() { setTimeout(function() {
delete self._outstandingOffers[dst][src] delete self._outstandingOffers[dst][src]
}, 30000); }, 5000);
this._outstandingOffers[dst][src].push(Array.prototype.slice.apply(arguments)); this._outstandingOffers[dst][src].push(Array.prototype.slice.apply(arguments));
} else if (type === 'LEAVE' && !dst) { } else if (type === 'LEAVE' && !dst) {
this._removePeer(src); this._removePeer(src);