Skip to content

Conversation

@phsultan
Copy link
Contributor

This PR adds a new example to the list that sends a given amount of data over a RTCDataChannel and gets it back.

It's basically like the ping/pong example with two variables:

  • the maximum size of a single packet to send (64KiB is the maximum value for all browsers)
  • the maximum size of the data to transfer as a whole (which can vary depending on the value set for the value above, among other parameters)

Data is chunked into pieces, which are queued to be sent over the RTCDataChannel, and depending on the browser's maximum buffer send value (and also in the underlying usrsctp library) or even on the chunk size, you may or may not be allowed to send a given amount of data.

This example just puts in evidence, hopefully in a convenient way and using node-webrtc, what has been well described in various places:

Can also provide some form of answer to node-webrtc/node-webrtc#464

Hope this helps!

@markandrus
Copy link
Member

Nice demo! Thanks

@markandrus markandrus merged commit 5919dcd into node-webrtc:master Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants