Ping backup connection at a slower rate
and make it configurable from the app.
Changed the decision on whether a connection is pingable:
1.Check whether a connection is a backup connection. A connection is considered as a backup connection only if the channel is complete, the connection is active and it is not the best connection.
2. Ping a non-backup connection if it is active and for backup connection, ping it at a slower rate.
Note the default behavior is the same as before.
Also cached the channel state since we are accessing it more often.
BUG=webrtc:5034
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1455033004 .
Cr-Commit-Position: refs/heads/master@{#10900}
diff --git a/talk/app/webrtc/peerconnectioninterface.h b/talk/app/webrtc/peerconnectioninterface.h
index 8e72547..100d8ce 100644
--- a/talk/app/webrtc/peerconnectioninterface.h
+++ b/talk/app/webrtc/peerconnectioninterface.h
@@ -253,7 +253,8 @@
TcpCandidatePolicy tcp_candidate_policy;
int audio_jitter_buffer_max_packets;
bool audio_jitter_buffer_fast_accelerate;
- int ice_connection_receiving_timeout;
+ int ice_connection_receiving_timeout; // ms
+ int ice_backup_candidate_pair_ping_interval; // ms
ContinualGatheringPolicy continual_gathering_policy;
std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates;
bool disable_prerenderer_smoothing;
@@ -265,6 +266,7 @@
audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets),
audio_jitter_buffer_fast_accelerate(false),
ice_connection_receiving_timeout(kUndefined),
+ ice_backup_candidate_pair_ping_interval(kUndefined),
continual_gathering_policy(GATHER_ONCE),
disable_prerenderer_smoothing(false) {}
};