W3C home > Mailing lists > Public > public-webrtc@w3.org > May 2015

Data Channel Buffer Management Proposal

From: Benjamin Schwartz <bemasc@google.com>
Date: Mon, 18 May 2015 14:43:23 -0400
Message-ID: <CAHbrMsBuqJDEm-R9VmwWbNEqxBHOwK0j+8ZSMcg2Yd650SbBeQ@mail.gmail.com>
To: "public-webrtc@w3.org" <public-webrtc@w3.org>
Right now, the data channel specification allows the sender to check the
amount of pending outbound data using the ".bufferedAmount" property.  In
fact, senders are effectively required to check this value when sending
large amounts, to avoid queueing up too much data in memory.  However, if
the sender does need to wait for bufferedAmount to decrease, it must use
timer-based polling to determine when bufferedAmount has decreased, and it
is safe to send again.

To remove the need for polling, I propose the following addition to the
RTCDataChannel API:

Promise<void> waitForBufferedAmountBelow (unsigned long amount);

This method returns a Promise that resolves when this.bufferedAmount <=
amount, or rejects if the channel reaches the "closed" state.


P.S.  This issue has also been discussed at
Received on Monday, 18 May 2015 18:43:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:44 UTC