Skip to content

A small proposal to cleanup DataChannel construction #60

Closed
@aboba

Description

@aboba

From: Peter Thatcher pthatcher@google.com
Date: Tue, 15 Apr 2014 10:04:54 -0700
Message-ID: CAJrXDUFaEUBx5ezDJ4M5gsoFg7gYRpWqA4JRUmD-=TLVv-Ovmw@mail.gmail.com
To: "public-ortc@w3.org" public-ortc@w3.org
URL: http://lists.w3.org/Archives/Public/public-ortc/2014Apr/0062.html

I've noticed that createDataChannel and the RTCDataChannel contructor
overlap in functionality. And since almost all of the current API is based
around using constructors instead of factory methods, I think we can
cleanup the overlap and make it consistent with the rest of the API by
doing the following:

[Constructor(RTCDataTransport transport,
RTCDataChannelParameters parameters)]
interface RTCDataChannel : EventTarget {
readonly attribute RTCDataTransport transport;
readonly attribute RTCDataChannelParameters parameters;
void send (Object data);
attribute EventHandler ondata;
};

interface RTCDataTransport {
}

interface RTCSctpTransport : RTCDataTransport {
// ...
}

The difference is basically that:

  1. We no longer have a createDataChannel method, and just call the
    constructor instead.
  2. RTCDataChannel no longer relies directly on SctpTransport. In the
    future, we could have a different kind of DataTransport and have
    DataChannels that work with it (we aren't as tightly coupled to SCTP).

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