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

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.


Received on Friday, 19 February 2010 11:07:14 UTC