Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

DataChannel: onopen chronological order #873

@backkem

Description

@backkem

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:

// 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions