Re: [Server-Sent Events] Infinite reconnection clarification

On Tue, 17 Apr 2012, Odin Hørthe Omdal wrote:
>
> If I understand correcly, the spec expects the implementation to keep 
> reconnecting indefinitely, when the network cable is yanked.

No. The spec says "Any other HTTP response code not listed here, and any 
network error that prevents the HTTP connection from being established in 
the first place (e.g. DNS errors), must cause the user agent to fail the 
connection." and "Once the user agent has failed the connection, it does 
not attempt to reconnect".

(In particular, note that "reestablish the connection" only ever occurs if 
the remote resource is actually obtained with the right MIME type.)



> I tried yanking the network for 10+ minutes, and when I put the cable in 
> again, both Firefox and Chromium used 25 seconds to reconnect. When only 
> yanking it for one minute, the reconnection was much faster (2-5 
> seconds). This with *reconnection time* set to 500ms.

As far as I can tell, none of that is conforming. If you yank the cable, 
they should retry once, then give up, per the spec.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 12 June 2012 00:56:27 UTC