This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14120 - Current spec for EventSource close method doesn't defined behaviour when close called after 'onopen' or 'onmessage'. For example, Google Chrome, closes connection if 'close' called while 'open' event dispatching and Opera doen't close it.
Summary: Current spec for EventSource close method doesn't defined behaviour when clos...
Status: RESOLVED INVALID
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Server-Sent Events (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 03:49 UTC by contributor
Modified: 2011-09-19 03:26 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2011-09-13 03:49:59 UTC
Specification: http://dev.w3.org/html5/eventsource/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:

Current spec for EventSource close method doesn't defined behaviour when close
called after 'onopen' or 'onmessage'.
For example, Google Chrome, closes connection if 'close' called while 'open'
method dispatching and Opera doen't close it.


Posted from: 90.151.254.137
User agent: Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.9.168 Version/11.51
Comment 1 Anne 2011-09-13 05:52:48 UTC
How is it not defined?
Comment 2 vic99999 2011-09-13 16:26:31 UTC
for example, event stream:

data: 1
data: 2
data: 3

code:

var es = new EventSource('stream');
es.addEventListener('open', function (event) {
  es.close();
}, false);

es.addEventListener('message', function (event) {
  alert(event.data);
  es.close();
}, false);

You will see different behavior for Chrome and Opera
Comment 3 vic99999 2011-09-19 03:26:27 UTC
>> The close() method must close the connection, if any; must abort any reconnection attempt, if any; and must set the readyState attribute to CLOSED. If the connection is already closed, the method must do nothing.
Sorry, didn't notice it in draft.