[whatwg] WebSocket bufferedAmount includes overhead or not

Boris Zbarsky bzbarsky at MIT.EDU
Tue Mar 30 21:56:17 PDT 2010


On 3/30/10 10:22 AM, Jonas Sicking wrote:
> Making it implementation dependent is likely to lead to website
> incompatibilities. Such as:
>
> ws = new WebSocket(...);
> ws.onopen = function() {
>    ws.send(someString);
>    if (ws.bufferedAmount>  X) {
>      doStuff();

Can bufferedAmount not change due to data actually hitting the network 
during the execution of this code?  As in, will all the someString data 
be buffered immediately after that send() call?

-Boris


More information about the whatwg mailing list