lib/RTCPeerConnection.js
function runTimerGatheringTimeout() {
		if (typeof self.options.gatheringTimeout !== 'number') {
			return;
		}
		// If setLocalDescription was already called, it may happen that
		// ICE gathering is not needed, so don't run this timer.
		if (self.pc.iceGatheringState === 'complete') {
			return;
		}

		debug('setLocalDescription() | ending gathering in %d ms (gatheringTimeout option)',
			self.options.gatheringTimeout);

		self.timerGatheringTimeout = setTimeout(function () {
			if (isClosed.call(self)) {
				return;
			}

			debug('forced end of candidates after gatheringTimeout timeout');

			// Clear gathering timers.
			delete self.timerGatheringTimeout;
			clearTimeout(self.timerGatheringTimeoutAfterRelay);
			delete self.timerGatheringTimeoutAfterRelay;

			// Ignore new candidates.
			self.ignoreIceGathering = true;
			if (self.onicecandidate) {
				self.onicecandidate({ candidate: null }, null);
			}

		}, self.options.gatheringTimeout);
	}
function runTimerGatheringTimeout() {
		if (typeof self.options.gatheringTimeout !== 'number') {
			return;
		}
		// If setLocalDescription was already called, it may happen that
		// ICE gathering is not needed, so don't run this timer.
		if (self.pc.iceGatheringState === 'complete') {
			return;
		}

		debug('setLocalDescription() | ending gathering in %d ms (gatheringTimeout option)',
			self.options.gatheringTimeout);

		self.timerGatheringTimeout = setTimeout(function () {
			if (isClosed.call(self)) {
				return;
			}

			debug('forced end of candidates after gatheringTimeout timeout');

			// Clear gathering timers.
			delete self.timerGatheringTimeout;
			clearTimeout(self.timerGatheringTimeoutAfterRelay);
			delete self.timerGatheringTimeoutAfterRelay;

			// Ignore new candidates.
			self.ignoreIceGathering = true;
			if (self.onicecandidate) {
				self.onicecandidate({ candidate: null }, null);
			}

		}, self.options.gatheringTimeout);
	}
function runTimerGatheringTimeout ( ) { if ( typeof self . options . gatheringTimeout !== 'number' ) { return ; } // If setLocalDescription was already called, it may happen that // ICE gathering is not needed, so don't run this timer. if ( self . pc . iceGatheringState === 'complete' ) { return ; } debug ( 'setLocalDescription() | ending gathering in %d ms (gatheringTimeout option)' , self . options . gatheringTimeout ) ; self . timerGatheringTimeout = setTimeout ( function ( ) { if ( isClosed . call ( self ) ) { return ; } debug ( 'forced end of candidates after gatheringTimeout timeout' ) ; // Clear gathering timers. delete self . timerGatheringTimeout ; clearTimeout ( self . timerGatheringTimeoutAfterRelay ) ; delete self . timerGatheringTimeoutAfterRelay ; // Ignore new candidates. self . ignoreIceGathering = true ; if ( self . onicecandidate ) { self . onicecandidate ( { candidate : null } , null ) ; } } , self . options . gatheringTimeout ) ; }
Handle gatheringTimeout.
Handle gatheringTimeout .