Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Haven't looked through the code yet. How does it handle stream backpressure with WebRTC?


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.


Thanks. 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: