-
Notifications
You must be signed in to change notification settings - Fork 42
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
DataChannel: onopen chronological order #873
Comments
@backkem yes, this is a problem point in the API. This is a problem with the original w3c specification for webrtc where this comes from. ORTC took this part of the spec as is from WebRTC to maintain compatibility. In the ortc lib implementation a lot of extra work went into holding onto any incoming data channels during this brief window and waiting for attachment of the event handler to then event at the right moment once the handler is attached but I'm not sure this solution is viable for all implementations. |
Thanks for the insight. I realize now that this problem also occurs in plain WebRTC when adding new data channels after signaling. In a future version of the API it would seem to make sense to mirror the |
I have to object - this isn't an issue in the world of browsers (which is what this spec is targeting). Yes, the underlying (native) data channel might open in parallel and perhaps even receive data. However, both the If this were an issue in browsers, It would be an issue if you would |
I was wondering how to ensure
OnOpen
is registered correctly when creating anew RTCDataChannel
using in-band negotiation. It seems this would look as follows:If I understand correctly
new RTCDataChannel
will instantly start off the in-band negotiation. Therefore the registering of theonopen
callback seems chronologically out of order. It seems there would be a (arguably tiny) changeonopen
would be called before the callback is correctly registered. Is this supposed to be handled in some way?The text was updated successfully, but these errors were encountered: