[ortc] Example 21 Issues

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

== Example 21 Issues ==
Example 21 is written from the perspective of the initiator of a 
DataChannel, however much of the code needs to be run on both ends (eg
 ice gathering, cert generation, dtls creation, etc).  Also, the 
ordering in starting both Sctp and the DataChannel is not correct.  
Toward the end of the sample: 

  `signaller.sendAccept({
    // ... include ICE/DTLS info from other examples.
    "sctpCapabilities": RTCSctpTransport.getCapabilities()
  });

  // Create the SctpTransport object and start it
  var sctp = new RTCSctpTransport(dtls);
  sctp.start(remote.sctpCapabilties);`

The problem with the above is that the allocated port isn't signaled, 
and that to obtain that, it is necessary to construct the 
SctpTransport.  So it should look more like this: 

  `// Create the SctpTransport object
  var sctp = new RTCSctpTransport(dtls);

  signaller.sendAccept({
    // ... include ICE/DTLS info from other examples.
    "sctpCapabilities": RTCSctpTransport.getCapabilities()
    "port": sctp.port
  });

  // Start the SctpTransport object
  sctp.start(remote.sctpCapabilties);`

To make things more clear, perhaps the order should be made explicit 
in the example:

`1.     Bob gets his sctp caps and sends them to Alice.
2.      Alice receives the caps and uses them to start her sctp 
channel.  Alice sends her caps back to Bob and listens for 
SctpChannel.OnDataChannel to fire.
3.      Bob receives the caps and uses them to start his sctp channel.
  Bob creates a DataChannel using the established sctp channel.
4.      Alice receives the SctpChannel.OnDataChannel event.  Data 
channel now open.`


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

Received on Monday, 23 January 2017 17:47:23 UTC