From 895e1a9dc3f520e9d86b1fa8b0808a4fd34d01fa Mon Sep 17 00:00:00 2001 From: Honghai Zhang Date: Tue, 16 Aug 2016 16:48:02 -0700 Subject: [PATCH] Change the default backup connection ping interval to 25 seconds. This avoids the issue that the backup connection may be pinged faster than the stable rate (once every 2.5 second) we have chosen for non-backup connections. R=deadbeef@webrtc.org, pthatcher@webrtc.org, zhihuang@webrtc.org Review URL: https://codereview.webrtc.org/2239423002 . Cr-Commit-Position: refs/heads/master@{#13787} --- webrtc/p2p/base/p2ptransportchannel.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc index 085185b172..cff9511888 100644 --- a/webrtc/p2p/base/p2ptransportchannel.cc +++ b/webrtc/p2p/base/p2ptransportchannel.cc @@ -85,6 +85,9 @@ static const int RECEIVING_SWITCHING_DELAY = 1000; // ms // We periodically check if any existing networks do not have any connection // and regather on those networks. static const int DEFAULT_REGATHER_ON_FAILED_NETWORKS_INTERVAL = 5 * 60 * 1000; + +static constexpr int DEFAULT_BACKUP_CONNECTION_PING_INTERVAL = 25 * 1000; + static constexpr int a_is_better = 1; static constexpr int b_is_better = -1; @@ -109,7 +112,7 @@ P2PTransportChannel::P2PTransportChannel(const std::string& transport_name, gathering_state_(kIceGatheringNew), check_receiving_interval_(MIN_CHECK_RECEIVING_INTERVAL * 5), config_(MIN_CHECK_RECEIVING_INTERVAL * 50 /* receiving_timeout */, - 0 /* backup_connection_ping_interval */, + DEFAULT_BACKUP_CONNECTION_PING_INTERVAL, GATHER_ONCE /* continual_gathering_policy */, false /* prioritize_most_likely_candidate_pairs */, STABLE_WRITABLE_CONNECTION_PING_INTERVAL,