3 ms·
I love that it uses chunks and streaming to transfer the file. So many of these just try and load the entire file at once so you can’t transfer much.
by nerdbaggy 6y ago
I love that it uses chunks and streaming to transfer the file. So many of these just try and load the entire file at once so you can’t transfer much.
- anderspitman 6y agoHaven't looked through the code yet. How does it handle stream backpressure with WebRTC?
- ryanar 6y agoWebRTC has built in mechanisms to check how many bytes have been buffered (RTCDataChannel.bufferedAmount), and you can register a low water mark (RTCDataChannel.bufferedamountlow) that fires an event handle when the buffered amount goes below that threshold (RTCDataChannel.onbufferedamountlow) where you can resume sending. WebRTC is sort of a combination of low-level and high-level APIs, but the ability to control backpressure ends up being very useful.
- anderspitman 6y agoThanks. Does bufferedAmount work better than it does on WebSockets[0], because I haven't had much luck with that. [0]: https://github.com/websockets/ws/issues/492 https://github.com/websockets/ws/issues/492