[whatwg] Collection garbage on WebSockets
simonp at opera.com
Mon Jun 28 08:32:32 PDT 2010
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
>> 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
>> (we have implemented this policy).
More information about the whatwg