node-webrtc / node-webrtc-examples

MediaStream and RTCDataChannel examples using node-webrtc
508 stars 161 forks source link

New example datachannel buffer limits #5

Closed phsultan closed 5 years ago

phsultan commented 5 years ago

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 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 https://github.com/node-webrtc/node-webrtc/issues/464

Hope this helps!

markandrus commented 5 years ago

Nice demo! Thanks