Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: webrtc/p2p/base/port.cc

Issue 2677743002: Increase STUN RTOs (Closed)
Patch Set: merge Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/p2p/base/stunport_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const int DEFAULT_RTT = 3000; // 3 seconds 67 const int DEFAULT_RTT = 3000; // 3 seconds
68 68
69 // Computes our estimate of the RTT given the current estimate. 69 // Computes our estimate of the RTT given the current estimate.
70 inline int ConservativeRTTEstimate(int rtt) { 70 inline int ConservativeRTTEstimate(int rtt) {
71 return std::max(MINIMUM_RTT, std::min(MAXIMUM_RTT, 2 * rtt)); 71 return std::max(MINIMUM_RTT, std::min(MAXIMUM_RTT, 2 * rtt));
72 } 72 }
73 73
74 // Weighting of the old rtt value to new data. 74 // Weighting of the old rtt value to new data.
75 const int RTT_RATIO = 3; // 3 : 1 75 const int RTT_RATIO = 3; // 3 : 1
76 76
77 // The delay before we begin checking if this port is useless. 77 // The delay before we begin checking if this port is useless. We set
78 const int kPortTimeoutDelay = 30 * 1000; // 30 seconds 78 // it to a little higher than a total STUN timeout.
79 const int kPortTimeoutDelay = cricket::STUN_TOTAL_TIMEOUT + 5000;
79 } // namespace 80 } // namespace
80 81
81 namespace cricket { 82 namespace cricket {
82 83
83 // TODO(ronghuawu): Use "host", "srflx", "prflx" and "relay". But this requires 84 // TODO(ronghuawu): Use "host", "srflx", "prflx" and "relay". But this requires
84 // the signaling part be updated correspondingly as well. 85 // the signaling part be updated correspondingly as well.
85 const char LOCAL_PORT_TYPE[] = "local"; 86 const char LOCAL_PORT_TYPE[] = "local";
86 const char STUN_PORT_TYPE[] = "stun"; 87 const char STUN_PORT_TYPE[] = "stun";
87 const char PRFLX_PORT_TYPE[] = "prflx"; 88 const char PRFLX_PORT_TYPE[] = "prflx";
88 const char RELAY_PORT_TYPE[] = "relay"; 89 const char RELAY_PORT_TYPE[] = "relay";
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 RTC_DCHECK(sent < 0); 1588 RTC_DCHECK(sent < 0);
1588 error_ = port_->GetError(); 1589 error_ = port_->GetError();
1589 stats_.sent_discarded_packets++; 1590 stats_.sent_discarded_packets++;
1590 } else { 1591 } else {
1591 send_rate_tracker_.AddSamples(sent); 1592 send_rate_tracker_.AddSamples(sent);
1592 } 1593 }
1593 return sent; 1594 return sent;
1594 } 1595 }
1595 1596
1596 } // namespace cricket 1597 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/base/stunport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698