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: Ian Hickson <ian@hixie.ch>
Date: Thu, 18 Feb 2010 22:59:57 +0000 (UTC)
To: Olli@pettay.fi
Cc: public-webapps@w3.org
Message-ID: <Pine.LNX.4.64.1002182256240.20980@ps20323.dreamhostps.com>
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.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 18 February 2010 23:00:26 GMT

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