W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > January 2017

Re: [webrtc-pc] Specify when a data channel's ID is assigned, and what the `id` attribute returns when no ID is assigned.

From: Taylor Brandstetter via GitHub <sysbot+gh@w3.org>
Date: Thu, 26 Jan 2017 22:17:12 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-275531573-1485469031-sysbot+gh@w3.org>
#746 deals with calling `createDataChannel` with an invalid ID. This 
issue deals with calling `createDataChannel` with *no* ID (letting the
 browser choose the ID). Maybe an example will clear things up:

```
pc = new RTCPeerConnection();
dc = pc.createDataChannel("foo");
// What is dc.id? 65535 or null?
// ...
pc.setLocalDescription(offer);
// ...
pc.setRemoteDescription(answer_with_active_role);
// Now we know the DTLS role. An odd value (1) is chosen for dc.id.
```

I think it would be pretty uncontroversial to say the DTLS role (and 
thus the data channel ID) is chosen when applying an answer. So the 
main question is what the `id` attribute returns when no ID is chosen 
yet.

-- 
GitHub Notification of comment by taylor-b
Please view or discuss this issue at 
https://github.com/w3c/webrtc-pc/issues/795#issuecomment-275531573 
using your GitHub account
Received on Thursday, 26 January 2017 22:17:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 4 June 2019 15:32:41 UTC