Chromium Code Reviews

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

Issue 1944003002: Increase the stun ping interval. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with Issue 2009763002. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 57 matching lines...)
68 // Computes our estimate of the RTT given the current estimate. 68 // Computes our estimate of the RTT given the current estimate.
69 inline int ConservativeRTTEstimate(int rtt) { 69 inline int ConservativeRTTEstimate(int rtt) {
70 return std::max(MINIMUM_RTT, std::min(MAXIMUM_RTT, 2 * rtt)); 70 return std::max(MINIMUM_RTT, std::min(MAXIMUM_RTT, 2 * rtt));
71 } 71 }
72 72
73 // Weighting of the old rtt value to new data. 73 // Weighting of the old rtt value to new data.
74 const int RTT_RATIO = 3; // 3 : 1 74 const int RTT_RATIO = 3; // 3 : 1
75 75
76 // The delay before we begin checking if this port is useless. 76 // The delay before we begin checking if this port is useless.
77 const int kPortTimeoutDelay = 30 * 1000; // 30 seconds 77 const int kPortTimeoutDelay = 30 * 1000; // 30 seconds
78
honghaiz3 2016/06/02 00:03:57 please remove this change.
78 } // namespace 79 } // namespace
79 80
80 namespace cricket { 81 namespace cricket {
81 82
82 // TODO(ronghuawu): Use "host", "srflx", "prflx" and "relay". But this requires 83 // TODO(ronghuawu): Use "host", "srflx", "prflx" and "relay". But this requires
83 // the signaling part be updated correspondingly as well. 84 // the signaling part be updated correspondingly as well.
84 const char LOCAL_PORT_TYPE[] = "local"; 85 const char LOCAL_PORT_TYPE[] = "local";
85 const char STUN_PORT_TYPE[] = "stun"; 86 const char STUN_PORT_TYPE[] = "stun";
86 const char PRFLX_PORT_TYPE[] = "prflx"; 87 const char PRFLX_PORT_TYPE[] = "prflx";
87 const char RELAY_PORT_TYPE[] = "relay"; 88 const char RELAY_PORT_TYPE[] = "relay";
(...skipping 1417 matching lines...)
1505 ASSERT(sent < 0); 1506 ASSERT(sent < 0);
1506 error_ = port_->GetError(); 1507 error_ = port_->GetError();
1507 sent_packets_discarded_++; 1508 sent_packets_discarded_++;
1508 } else { 1509 } else {
1509 send_rate_tracker_.AddSamples(sent); 1510 send_rate_tracker_.AddSamples(sent);
1510 } 1511 }
1511 return sent; 1512 return sent;
1512 } 1513 }
1513 1514
1514 } // namespace cricket 1515 } // namespace cricket
OLDNEW

Powered by Google App Engine