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

[whatwg] WebSocket bufferedAmount includes overhead or not

From: Anne van Kesteren <annevk@opera.com>
Date: Thu, 25 Mar 2010 10:11:51 +0100
Message-ID: <op.u93851ur64w2qv@annevk-t60>
On Wed, 24 Mar 2010 23:08:43 +0100, Olli Pettay <Olli.Pettay at helsinki.fi>  
wrote:
> On 3/24/10 11:33 PM, Ian Hickson wrote:
>> I guess I'm unclear on whether bufferedAmount should return:
>>
>> 1. the sum of the count of characters sent?
>>     (what would we do when we add binary?)
>
> I believe this is actually what we want.
> If web developer sends a string which is X long,
> bufferedAmount should report X.
>
> And when we add binary, if buffer which has size Y is
> sent, that Y is added to bufferedAmount.
>
> The reason why I'd like it to work this way is that
> IMO scripts should be able to check whether the data
> they have posted is actually sent over the network.

Wait, so when you pass a DOMString you add the number of 16-bit units and  
when you pass a ByteArray (or whatever we end up calling it) you add the  
number of bytes?


I think what also matters here is how the protocol will evolve. Is it that  
expectation that send(DOMString) can eventually send very different things  
over the wire depending on how the server reacts to the initial handshake  
request? How do the various options we have evaluate against the potential  
scenarios coming out of that?


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Thursday, 25 March 2010 02:11:51 UTC

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