W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2010

Re: Web Sockets API, buffer handling after the connection is closed

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Fri, 19 Feb 2010 13:06:30 +0200
Message-ID: <4B7E70B6.9070800@helsinki.fi>
To: Ian Hickson <ian@hixie.ch>
CC: Jonas Sicking <jonas@sicking.cc>, public-webapps@w3.org, Wellington Fernando de Macedo <wfernandom2004@gmail.com>
On 2/19/10 12:59 AM, Ian Hickson wrote:
> On Thu, 18 Feb 2010, Olli Pettay wrote:
>>
>> I wonder why send() needs to buffer anything after the connection is
>> closed. bufferedAmount is defined: "If the connection is closed, this
>> attribute's value will only increase with each call to the send() method
>> (the number does not reset to zero once the connection closes)"
>>
>> Why not clear the buffer right after dispatching close event and then
>> throw if send() is called, or something similar?
>
> It's so that if you write code that just sends continuously, you'll stop
> sending once the connection dies, even if you miss the close event.
>
> The UA doesn't have to actually buffer, just keep increasing the number by
> the length each time you get a send while closed.
>


Ok. The API is ugly, but I don't care enough to start arguing
against it.


-Olli
Received on Friday, 19 February 2010 11:07:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:37 GMT