w3c / webrtc-ice

Extension to the RTCIceTransport interface defined in WebRTC 1.0
https://w3c.github.io/webrtc-ice/
Other
9 stars 14 forks source link

RTCIceTransport role before start() called #4

Open steveanton opened 6 years ago

steveanton commented 6 years ago

The RTCIceTransport role attribute is inherited from the WebRTC-PC specification.

It's not clear what the role attribute should be before start() is called. Should role be an optional?

The WebRTC-PC specification does not have this problem since an RTCIceTransport is not created until the offer/answer exchange has started.

aboba commented 6 years ago

In ORTC, role does not take on a value prior to calling start(). From http://draft.ortc.org/#rtcicegatherer-overview* :

"As noted in [RFC5245] Section 7.1.2.2, an incoming connectivity check contains an ICE-CONTROLLING or ICE-CONTROLLED attribute, depending on the role of the ICE agent initiating the check. Since an RTCIceGatherer object does not have a role, it cannot determine whether to respond to an incoming connectivity check with a 487 (Role Conflict) error; however, it can validate that an incoming connectivity check utilizes the correct local username fragment and password, and if not, can respond with an 401 (Unauthorized) error, as described in [RFC5389] Section 10.1.2.

For incoming connectivity checks that pass validation, the RTCIceGatherer MUST buffer the incoming connectivity checks so as to be able to provide them to associated RTCIceTransport objects so that they can respond."

Also from http://draft.ortc.org/#dom-rtcicetransport-start :

"Since start() provides role information, as well as the remote username fragment and password, once start() is called an RTCIceTransport object can respond to incoming connectivity checks based on its configured role."

foolip commented 6 years ago

Nullable enums are very rare on the web platform, to the point that it's been suggested to simply disallow it in Web IDL: https://github.com/heycam/webidl/issues/213

The suggested alternative pattern is simply another enum value which represents this state, which could the empty string, or in this case perhaps "pending", "unknown" or similar.

foolip commented 6 years ago

However, there are already nullable enums here: https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver

alvestrand commented 6 years ago

What we've done with several states on the platform is to name the just-created-but-not-ready-for-prime-time state "new". That would work for me here too - can't be mistaken for anything else.

lgrahl commented 6 years ago

An explicit unknown role sounds good to me. But I think start() shouldn't allow for it to be used.