From 3eb0a37b94615cf31aac8f1599afd07162f90416 Mon Sep 17 00:00:00 2001 From: aboba Date: Wed, 26 Feb 2020 14:58:57 -0800 Subject: [PATCH 1/4] Add initial FlexICE methods and attributes Rebase of PR https://github.com/w3c/webrtc-ice/pull/22 with fixes, minus fork(). --- index.html | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 280 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 074e232..32173ef 100644 --- a/index.html +++ b/index.html @@ -135,6 +135,7 @@

RTCIceGatherOptions Dictionary

dictionary RTCIceGatherOptions {
              RTCIceTransportPolicy     gatherPolicy = "all";
              sequence<RTCIceServer> iceServers;
+             sequence<DOMString>? networkIds;
 };

Dictionary RTCIceGatherOptions Members

@@ -152,6 +153,13 @@

Dictionary RTCIceGatherOptions Members

provide default ICE servers, and applications can desire to restrict communications to the local LAN, iceServers need not be set.

+
networkIds of type sequence<DOMString>
+
+

If set and non-null, ICE gathering will be limited to the network + interfaces specfied by the network IDs (obtained by + calling getLocalCandidates().

+
@@ -167,8 +175,12 @@

Interface Definition

void start (RTCIceParameters remoteParameters, optional RTCIceRole role = "controlled"); void stop (); void addRemoteCandidate (RTCIceCandidateInit remoteCandidate); + void retainLocalCandidate (RTCIceCandidateInit localCandidate); + void removeLocalCandidate (RTCIceCandidateInit localCandidate); + sequence<RTCIceCandidatePair> getCandidatePairs(); attribute EventHandler onerror; - attribute EventHandler onicecandidate; + attribute EventHandler onlocalcandidate; + attribute EventHandler onchecksent; };

Constructors

@@ -213,12 +225,18 @@

Attributes

"MUST">MUST be fired if an error occurs in the gathering of ICE candidates (such as if TURN credentials are invalid).

-
onicecandidate of type onlocalcandidate of type EventHandler

This event handler utilizes the event handler event type icecandidate.

+
onchecksent of type EventHandler
+
+

This event handler utilizes the event handler event type + icecheck. +

@@ -498,6 +516,259 @@

Methods

Return type: void +
removeLocalCandidate
+
+

Removes the given local candidate. This will trigger + the removal of all candidate pairs with the given local + candidate, the prevention of pairing with the given + local candidate, and prevention of any network activity + using the given local candidate.

+ + + + + + + + + + + + + + + + + +
ParameterTypeNullableOptionalDescription
localCandidateRTCIceCandidate
+
+ Return type: void +
+
+
retainLocalCandidate
+
+

Cause the RTCIceTransport to + not automatically remove the local candidate due + to ICE pruning (such as when a candidate pair with + a different local candidate is selected). However, + the local candidate may be removed if it completely + fails (such as a network interface going down).

+ + + + + + + + + + + + + + + + + +
ParameterTypeNullableOptionalDescription
localCandidateRTCIceCandidate
+
+ Return type: void +
+
+
getCandidatePairs()
+
+

Return all the candidate pairs.

+
+ Return type: sequence<RTCIceCandidatePair> +
+
+
+

Interface Definition

+
+
[Exposed=Window]
+partial dictionary RTCIceCandidateInit {
+    attribute DOMString? networkId;
+    // TODO: Add reference to https://wicg.github.io/netinfo/#dom-networkinformation
+    attribute NetworkInformation? networkInfo;
+};
+
+

Attributes

+
+
networkId of type DOMString
+
+ An ID of the network interface for use in gathering + options. It needs to be unique enough to fulfill that + purpose, but otherwise the value is not significant. +
+
networkInfo of type NetworkInformation
+
+ Information about the network interface. +
+
+
+
+
+
+

Interface Definition

+
+
[Exposed=Window]
+partial interface RTCIceCandidatePairInt {
+    void setMinCheckInterval(double seconds);
+    void setFrozen(bool frozen);
+    void select();
+    Promise nominate();
+    Promise waitForReceiveTimeout(double seconds);	    
+};
+
+

Methods

+
+
setMinCheckInterval
+
+

Causes the RTCIceTransport to send ICE checks using + this candidate pair no more frequently than indicated by + the given interval (given in seconds). The + RTCIceTransport may always send less frequently than + specified.

+ + + + + + + + + + + + + + + + + +
ParameterTypeNullableOptionalDescription
secondsdouble
+
+ Return type: void +
+
+
setFrozen
+
+

Freezes or unfreezes the candidate pair. When frozen, + no ICE checks will be sent over it.

+ + + + + + + + + + + + + + + + + +
ParameterTypeNullableOptionalDescription
frozenboolean
+
+ Return type: void +
+
+
select
+
+

Selects the candidate pair. Once this is called + once, the RTCIceTransport + will no longer automatically select candidate + pairs and the only way to change the selected + candidate pair will be calling select() again + will change the selected candidate pair again.

+
+ Return type: void +
+
+
nominate
+
+

Nominates the candidate pair by sending a nomination + to the remote side. Resolves the returned promise once + the nomination has been sent or once it has been + determined that it is impossible to nominate (for + example, if aggressive nomination and renomination are + both unavailable due to the ICE options and a nomination + has already been sent.

+
+ Return type: Promise<boolean> +
+
+
waitForReceiveTimeout
+
+

Wait until no network pacekts have been received for + more than the given timeout. This allows the detection + of network outage. If called a second time on the same + RTCIceTransport, the previous + call's promise is rejected immediately. Thus only + one pending wait per RTCIceTransport + is allowed at a time.

+ + + + + + + + + + + + + + + + + +
ParameterTypeNullableOptionalDescription
secondsdouble
+
+ Return type: void +
+
+
+
+
+
+

Interface Definition

+
+
[Exposed=Window]
+interface RTCIceCheck {
+    readonly        attribute Promise response;
+};
+
+

Attributes

+
+
response of type boolean
+
+ A promise that resolves when the RTCIceTransport + receives a response to the check. Resolves with a true + value if the response is successful and false if the + response was an error. +
@@ -580,6 +851,12 @@

Event summary

A new RTCIceCandidate is made available to the script. + + icecheck + RTCIceCheckEvent + A new RTCIceCheck is made available to the + script. +
@@ -595,7 +872,7 @@

Change Log

Acknowledgements

The editors wish to thank the Working Group chairs and Team Contact, - Harald Alvestrand, Stefan Håkansson, Bernard Aboba and Dominique + Harald Alvestrand, Jan-Ivar Bruaroey, Stefan Håkansson and Dominique Hazaël-Massieux, for their support. Contributions to this specification were provided by Robin Raymond.

The RTCIceTransport object From 5afd18c17ea171eab6e90cbdf97ba09c706f68d2 Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Fri, 28 Feb 2020 11:40:45 -0800 Subject: [PATCH 2/4] Fix respec errors --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 32173ef..92c001c 100644 --- a/index.html +++ b/index.html @@ -746,6 +746,7 @@

Methods

Return type: void
+
@@ -764,10 +765,11 @@

Attributes

response of type boolean
- A promise that resolves when the RTCIceTransport +

A promise that resolves when the + RTCIceTransport receives a response to the check. Resolves with a true value if the response is successful and false if the - response was an error. + response was an error.

From ef29266af484c5e2a76ab66bcb47044795596f3b Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Fri, 28 Feb 2020 11:45:57 -0800 Subject: [PATCH 3/4] respec fixes --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 92c001c..39fee74 100644 --- a/index.html +++ b/index.html @@ -586,6 +586,7 @@

Methods

Return type: sequence<RTCIceCandidatePair> +

Interface Definition

@@ -621,7 +622,7 @@

Interface Definition

[Exposed=Window]
 partial interface RTCIceCandidatePairInt {
     void setMinCheckInterval(double seconds);
-    void setFrozen(bool frozen);
+    void setFrozen(boolean frozen);
     void select();
     Promise nominate();
     Promise waitForReceiveTimeout(double seconds);	    

From 00f26b65783526baf6be95beea80ca95a68147d8 Mon Sep 17 00:00:00 2001
From: Bernard Aboba 
Date: Fri, 28 Feb 2020 11:50:34 -0800
Subject: [PATCH 4/4] Fix respec errors

---
 index.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/index.html b/index.html
index 39fee74..93288ce 100644
--- a/index.html
+++ b/index.html
@@ -586,6 +586,7 @@ 

Methods

Return type: sequence<RTCIceCandidatePair>
+

Interface Definition