[whatwg] Collection garbage on WebSockets

Wellington Fernando de Macedo wfernandom2004 at gmail.com
Mon Jun 28 07:42:45 PDT 2010


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.

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

Wellington.




More information about the whatwg mailing list