3 ms·
WebRTC has built in mechanisms to check how many bytes have been buffered (RTCDataChannel.bufferedAmount), and you can register a low water mark (RTCDataChannel
by ryanar 6y ago
WebRTC 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