Add configurable connectivity check intervals.
The connectivity check intervals for candidate pairs with strong and weak connectivity are currently constants in the ICE implementation. A set of suboptimal value of these constants for a given application may result in undesirable behavior including excessive network switching latency. This CL adds these intervals to RTCConfiguration that is available to applications to configure, while maintaining the original constants as their default value for compatibility with existing applications. Bug: webrtc:8988 Change-Id: I804b0f4cf7881be7d3c8aec2776bc9596de72482 Reviewed-on: https://webrtc-review.googlesource.com/60585 Commit-Queue: Qingsi Wang <qingsi@google.com> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22351}
This commit is contained in:
@ -386,6 +386,28 @@ public class PeerConnection {
|
||||
public int iceCandidatePoolSize;
|
||||
public boolean pruneTurnPorts;
|
||||
public boolean presumeWritableWhenFullyRelayed;
|
||||
// The following fields define intervals in milliseconds at which ICE
|
||||
// connectivity checks are sent.
|
||||
//
|
||||
// We consider ICE is "strongly connected" for an agent when there is at
|
||||
// least one candidate pair that currently succeeds in connectivity check
|
||||
// from its direction i.e. sending a ping and receives a ping response, AND
|
||||
// all candidate pairs have sent a minimum number of pings for connectivity
|
||||
// (this number is implementation-specific). Otherwise, ICE is considered in
|
||||
// "weak connectivity".
|
||||
//
|
||||
// Note that the above notion of strong and weak connectivity is not defined
|
||||
// in RFC 5245, and they apply to our current ICE implementation only.
|
||||
//
|
||||
// 1) iceCheckIntervalStrongConnectivityMs defines the interval applied to
|
||||
// ALL candidate pairs when ICE is strongly connected,
|
||||
// 2) iceCheckIntervalWeakConnectivityMs defines the counterpart for ALL
|
||||
// pairs when ICE is weakly connected, and
|
||||
// 3) iceCheckMinInterval defines the minimal interval (equivalently the
|
||||
// maximum rate) that overrides the above two intervals when either of them
|
||||
// is less.
|
||||
public Integer iceCheckIntervalStrongConnectivityMs;
|
||||
public Integer iceCheckIntervalWeakConnectivityMs;
|
||||
public Integer iceCheckMinInterval;
|
||||
// The interval in milliseconds at which STUN candidates will resend STUN binding requests
|
||||
// to keep NAT bindings open.
|
||||
@ -437,6 +459,8 @@ public class PeerConnection {
|
||||
iceCandidatePoolSize = 0;
|
||||
pruneTurnPorts = false;
|
||||
presumeWritableWhenFullyRelayed = false;
|
||||
iceCheckIntervalStrongConnectivityMs = null;
|
||||
iceCheckIntervalWeakConnectivityMs = null;
|
||||
iceCheckMinInterval = null;
|
||||
stunCandidateKeepaliveIntervalMs = null;
|
||||
disableIPv6OnWifi = false;
|
||||
@ -529,6 +553,16 @@ public class PeerConnection {
|
||||
return presumeWritableWhenFullyRelayed;
|
||||
}
|
||||
|
||||
@CalledByNative("RTCConfiguration")
|
||||
Integer getIceCheckIntervalStrongConnectivity() {
|
||||
return iceCheckIntervalStrongConnectivityMs;
|
||||
}
|
||||
|
||||
@CalledByNative("RTCConfiguration")
|
||||
Integer getIceCheckIntervalWeakConnectivity() {
|
||||
return iceCheckIntervalWeakConnectivityMs;
|
||||
}
|
||||
|
||||
@CalledByNative("RTCConfiguration")
|
||||
Integer getIceCheckMinInterval() {
|
||||
return iceCheckMinInterval;
|
||||
|
||||
Reference in New Issue
Block a user