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

[whatwg] Collection garbage on WebSockets

From: Simon Pieters <simonp@opera.com>
Date: Mon, 28 Jun 2010 17:32:32 +0200
Message-ID: <op.ve0n4iheidj3kv@simon-pieterss-macbook.local>
On Mon, 28 Jun 2010 16:42:45 +0200, Wellington Fernando de Macedo  
<wfernandom2004 at gmail.com> wrote:

> Em 28/06/2010 11:28, Simon Pieters escreveu:
>>>   * When at least one open or message events has been received, and  
>>> there are
>>> close events listeners (the close event could be flagged as 'strong'  
>>> in this
>>> case);
>> You can get close event without an open event first. (I don't think  
>> Firefox gets this right currently.)
> That situation only can happen (in Firefox) when the js script calls the  
> Close() method and the readyState == CONNECTING.
> When the connection can't be established for any reason the WebSocket  
> object stays in the CONNECTING
> readyState and doesn't dispatch any events. That behavior is because of  
> the section "6.1. Client-initiated closure"
> of the WebSocket protocol spec, in order to prevent script to  
> distinguish any of the situations listed there.

AFAICT, the spec requires a close event to be fired if the connection  
fails for any reason. It's just that the API shouldn't expose the reason  
for the close to Web pages.

>> Also see  
>> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-May/026400.html  
>> (we have implemented this policy).
> Thanks!
> Wellington.

Simon Pieters
Opera Software
Received on Monday, 28 June 2010 08:32:32 UTC

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