Skip to content

RTCIceCandidate.tcpType for UDP candidates #608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lgrahl opened this issue Oct 18, 2016 · 6 comments
Closed

RTCIceCandidate.tcpType for UDP candidates #608

lgrahl opened this issue Oct 18, 2016 · 6 comments

Comments

@lgrahl
Copy link
Contributor

lgrahl commented Oct 18, 2016

Which RTCIceTcpCandidateType should a RTCIceCandidate with udp protocol have?

Should the field be optional? Should it be empty string or null for UDP candidates? The spec should describe that.

@taylor-b
Copy link

In WebRTC it's just optional, I think that makes the most sense.

@lgrahl
Copy link
Contributor Author

lgrahl commented Oct 18, 2016

Making it optional would be inconsistent regarding relatedAddress and relatedPort which are emtpy string and 0 instead of being optional.

@lgrahl
Copy link
Contributor Author

lgrahl commented Oct 18, 2016

But in general, I agree that ORTC should mimic RTCIceCandidate of the WebRTC spec. However, the WebRTC spec is not consistent here either as it makes the fields optional but in the description their values should be null if not available. To me, null is not the same thing as not set (optional).

@taylor-b
Copy link

I forgot; in the WebRTC spec, RTCIceCandidate is an interface rather than a dictionary, so the only option is to have nullable attributes. So it's hard to draw an exact parallel. But null would be a closer match than an empty string.

@lgrahl
Copy link
Contributor Author

lgrahl commented Oct 19, 2016

Oh, thanks, that explains it. null would be okay for tcpType, but relatedAddress and relatedPort would have to be updated as well to avoid inconsistencies. However, setting relatedPort to null would violate its type. This is somewhat problematic for APIs written in languages that require static types. To me, making all three fields optional seems to be the best solution so far.

@aboba
Copy link
Contributor

aboba commented Oct 26, 2016

@lgrahl The optionality of the three fields can be made clear by adding "required" to the other fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants