[whatwg] WebSocket bufferedAmount includes overhead or not

Perry Smith pedzsan at gmail.com
Fri Mar 26 14:18:53 PDT 2010


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.

pedz




More information about the whatwg mailing list