W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2009

[whatwg] Thread to run Web Socket feedback from the protocol ?

From: Alexey Proskuryakov <ap@webkit.org>
Date: Wed, 09 Dec 2009 10:44:56 -0800
Message-ID: <E4EC4CDC-F53D-4D53-B4DC-145750DF6611@webkit.org>

On 09.12.2009, at 10:07, Ian Hickson wrote:

>>> I'm absolutely fine with changing WebSocket to change readyState as
>>> part of the same task that dispatches the event
>>
>> Yes, that is what I think the spec should say.
>
> Done.


As discussed on IRC, this leaves us with a race condition between  
close() and queued messages. The spec says that once close() is  
invoked, incoming data should be dropped, but queued tasks to dispatch  
message event will still be coming.

This race condition can of course be fixed without much difficulty. It  
may be more difficult to similarly rearrange XHR specs.

I find it unfortunate that where the spec says "queue a task", most  
(or all) implementations will perform those actions immediately. This  
may be indistinguishable from JavaScript client code, but it will be a  
source of confusion for developers.

- WBR, Alexey Proskuryakov
Received on Wednesday, 9 December 2009 10:44:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:54 UTC