[ortc] DataChannel: onopen chronological order (#873)

backkem has just created a new issue for https://github.com/w3c/ortc:

== DataChannel: onopen chronological order ==
I was wondering how to ensure `OnOpen` is registered correctly when creating a `new RTCDataChannel` using in-band negotiation. It seems this would look as follows:
```JS
// Create the data channel object
var channel = new RTCDataChannel(sctp, parameters);
// Register OnOpen
channel.onopen = () => handleOnOpen(channel);
```
If I understand correctly `new RTCDataChannel` will instantly start off the in-band negotiation. Therefore the registering of the `onopen` callback seems chronologically out of order. It seems there would be a (arguably tiny) change `onopen` would be called before the callback is correctly registered. Is this supposed to be handled in some way?

Please view or discuss this issue at https://github.com/w3c/ortc/issues/873 using your GitHub account

Received on Friday, 21 December 2018 15:25:30 UTC