This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22428 - Please unify the WebSocket and RTCDataChannel "readyState". enum RTCDataChannelState { "connecting", "open", "closing", "closed" }; VS const unsigned short CONNECTING = 0 [...]
Summary: Please unify the WebSocket and RTCDataChannel "readyState". enum RTCDataChann...
Status: RESOLVED WONTFIX
Alias: None
Product: WebRTC Working Group
Classification: Unclassified
Component: WebRTC API (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Web RTC Working Group
QA Contact:
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-23 18:02 UTC by contributor
Modified: 2013-12-06 14:06 UTC (History)
7 users (show)

See Also:


Attachments

Description contributor 2013-06-23 18:02:02 UTC
Specification: http://dev.w3.org/html5/websockets/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top
Referrer: 

Comment:
Please unify the WebSocket and RTCDataChannel "readyState".

enum RTCDataChannelState {
    "connecting",
    "open",
    "closing",
    "closed"
};

VS

const unsigned short CONNECTING = 0;
const unsigned short OPEN = 1;
const unsigned short CLOSING = 2;
const unsigned short CLOSED = 3;

I personally prefer the enum. The "close" method also slightly differs and
could be synced.

Posted from: 85.178.10.173
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20130618 Firefox/24.0
Comment 1 Simon Pieters 2013-06-23 18:20:27 UTC
WebSocket has shipped in multiple browsers and I believe it is pretty widely used at this point.
Comment 2 Ian 'Hixie' Hickson 2013-07-02 22:57:21 UTC
Yeah, if you want this unified, it has to be done on the RTC side.
Comment 3 Adam Bergkvist 2013-07-03 05:44:38 UTC
This thread contains the discussion that lead to us using strings instead of numeric constants:

http://lists.w3.org/Archives/Public/public-webrtc/2012Feb/0119.html

It's a bit of a tricky situation. DataChannel is a new API and should therefore use the latest conventions, but at the same time we're modeling it after an existing API and want to make it easy to switch between the two for different transport needs.
Comment 4 Harald Alvestrand 2013-12-06 14:06:34 UTC
Closing this as WONTFIX - the group has gone over this ground, and I think the decision to be internally consistent in the spec on using string enums was pretty solid at the time.