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:
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:
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 underlyingusrsctp
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 https://github.com/node-webrtc/node-webrtc/issues/464
Hope this helps!