W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2010

[whatwg] WebSocket bufferedAmount includes overhead or not

From: Perry Smith <pedzsan@gmail.com>
Date: Fri, 26 Mar 2010 16:18:53 -0500
Message-ID: <25B3A097-14D5-433C-B6EE-3F7281645B51@gmail.com>

On Mar 25, 2010, at 4:50 PM, Ian Hickson wrote:

> It seems that the consensus is now leaning towards changing the spec  
> again
> to include the overhead, but I haven't changed it yet because I  
> don't want
> to be flip-flopping back and forth -- if we change this, I don't  
> want to
> change it back. I think the use cases I know of are addressed  
> whether we
> include overhead or not, so from an objective perspective I don't  
> think it
> really matters, which makes this more of an opinion thing. I'd  
> encourage
> anyone else with an opinion on this to make their opinion known.  
> (Yes, I'm
> actually _asking_ for people to suggest colours for this bikeshed!)

As an author, I'd rather not know about the overhead.  To me it would  
be confusing to queue up 10 bytes and ask for bufferedAmount and get  
back 15.

The sample scripts are doing one of two things.  Either they are  
trying to prevent saturating the network and they are doing this by  
testing for bufferedAmount being equal to zero.  Or, they are trying  
to saturate the network given the existing interfaces.  I believe  
there are other options to allow the application to maintain an  
asynchronous interface and achieve saturation that would consume less  
cpu overhead.  I'm not sure if we want to open that can of worms in  
this thread or not.

Received on Friday, 26 March 2010 14:18:53 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC