Procházet zdrojové kódy

fix(JingleSession): Increase the ICE candidate gathering timeout to 150ms.

This will reduce the numbers of transport-info IQs sent by the client.
tags/v0.0.2
Jaya Allamsetty před 4 roky
rodič
revize
0dc1540a44
1 změnil soubory, kde provedl 8 přidání a 5 odebrání
  1. 8
    5
      modules/xmpp/JingleSessionPC.js

+ 8
- 5
modules/xmpp/JingleSessionPC.js Zobrazit soubor

@@ -39,6 +39,12 @@ const IQ_TIMEOUT = 10000;
39 39
  */
40 40
 const DEFAULT_MAX_STATS = 300;
41 41
 
42
+/**
43
+ * The time duration for which the client keeps gathering ICE candidates to be sent out in a single IQ.
44
+ * @type {number} timeout in ms.
45
+ */
46
+const ICE_CAND_GATHERING_TIMEOUT = 150;
47
+
42 48
 /**
43 49
  * @typedef {Object} JingleSessionPCOptions
44 50
  * @property {Object} abTesting - A/B testing related options (ask George).
@@ -603,9 +609,7 @@ export default class JingleSessionPC extends JingleSession {
603 609
         const localSDP = new SDP(this.peerconnection.localDescription.sdp);
604 610
 
605 611
         if (candidate && candidate.candidate.length && !this.lasticecandidate) {
606
-            const ice
607
-                = SDPUtil.iceparams(
608
-                    localSDP.media[candidate.sdpMLineIndex], localSDP.session);
612
+            const ice = SDPUtil.iceparams(localSDP.media[candidate.sdpMLineIndex], localSDP.session);
609 613
             const jcand = SDPUtil.candidateToJingle(candidate.candidate);
610 614
 
611 615
             if (!(ice && jcand)) {
@@ -620,14 +624,13 @@ export default class JingleSessionPC extends JingleSession {
620 624
 
621 625
             if (this.usedrip) {
622 626
                 if (this.dripContainer.length === 0) {
623
-                    // start 20ms callout
624 627
                     setTimeout(() => {
625 628
                         if (this.dripContainer.length === 0) {
626 629
                             return;
627 630
                         }
628 631
                         this.sendIceCandidates(this.dripContainer);
629 632
                         this.dripContainer = [];
630
-                    }, 20);
633
+                    }, ICE_CAND_GATHERING_TIMEOUT);
631 634
                 }
632 635
                 this.dripContainer.push(candidate);
633 636
             } else {

Načítá se…
Zrušit
Uložit