diff --git a/lib/server.js b/lib/server.js index 699475c..59be6cd 100644 --- a/lib/server.js +++ b/lib/server.js @@ -234,8 +234,6 @@ PeerServer.prototype._handleTransmission = function(message, res) { } else { 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) { res.send(200); } @@ -253,8 +251,9 @@ PeerServer.prototype._handleTransmission = function(message, res) { if (!!res) res.send(501); } } else { + // Wait 5 seconds for this client to connect/reconnect (XHR) for important + // messages. if (type !== 'LEAVE') { - // Wait 5 seconds for this client to connect. var self = this; if (!this._outstandingOffers[dst]) this._outstandingOffers[dst] = {}; @@ -262,7 +261,7 @@ PeerServer.prototype._handleTransmission = function(message, res) { this._outstandingOffers[dst][src] = []; setTimeout(function() { delete self._outstandingOffers[dst][src] - }, 30000); + }, 5000); this._outstandingOffers[dst][src].push(Array.prototype.slice.apply(arguments)); } else if (type === 'LEAVE' && !dst) { this._removePeer(src);