- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 28 Jul 2009 23:33:51 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/websockets
In directory hutz:/tmp/cvs-serv17010
Modified Files:
Overview.html
Log Message:
websocket: Define how buffering works a bit better; add a .bufferedAmount attribute and make send() return a boolean. (whatwg r3485)
Index: Overview.html
===================================================================
RCS file: /sources/public/html5/websockets/Overview.html,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- Overview.html 28 Jul 2009 22:13:00 -0000 1.93
+++ Overview.html 28 Jul 2009 23:33:49 -0000 1.94
@@ -331,12 +331,13 @@
const unsigned short <a href="#dom-websocket-open" title="dom-WebSocket-OPEN">OPEN</a> = 1;
const unsigned short <a href="#dom-websocket-closed" title="dom-WebSocket-CLOSED">CLOSED</a> = 2;
readonly attribute unsigned short <a href="#dom-websocket-readystate" title="dom-WebSocket-readyState">readyState</a>;
+ readonly attribute unsigned long <a href="#dom-websocket-bufferedamount" title="dom-WebSocket-bufferedAmount">bufferedAmount</a>;
// networking
attribute <span>Function</span> <a href="#handler-websocket-onopen" title="handler-WebSocket-onopen">onopen</a>;
attribute <span>Function</span> <a href="#handler-websocket-onmessage" title="handler-WebSocket-onmessage">onmessage</a>;
attribute <span>Function</span> <a href="#handler-websocket-onclose" title="handler-WebSocket-onclose">onclose</a>;
- void <a href="#dom-websocket-send" title="dom-WebSocket-send">send</a>(in DOMString data);
+ boolean <a href="#dom-websocket-send" title="dom-WebSocket-send">send</a>(in DOMString data);
void <a href="#dom-websocket-close" title="dom-WebSocket-close">close</a>();
};</pre><p><code><a href="#websocket">WebSocket</a></code> objects must also implement the
<code>EventTarget</code> interface. <a href="#references">[DOM3EVENTS]</a>
@@ -439,13 +440,24 @@
closed, however.) If the <var title="">data</var> argument has any
unpaired surrogates, then it must raise <code>SYNTAX_ERR</code>. If
the connection <em>is</em> established, and the string has no
- unpaired surrogates, then the user agent must <span>send <var title="">data</var> using the Web Socket</span>.<p>The <dfn id="dom-websocket-close" title="dom-WebSocket-close"><code>close()</code></dfn>
+ unpaired surrogates, then the user agent must <span>send <var title="">data</var> using the Web Socket</span>. If the data cannot
+ be sent, e.g. because it would need to be buffered but the buffer is
+ full, the user agent must <span>close the Web Socket
+ connection</span>. The method must then return true if the
+ connection is still established (and the data was queued or sent
+ successfully), or false if the connection is closed (e.g. because
+ the user agent just had a buffer overflow and failed to send the
+ data).<p>The <dfn id="dom-websocket-close" title="dom-WebSocket-close"><code>close()</code></dfn>
method must <span>close the Web Socket connection</span> or
connection attempt, if any. If the connection is already closed, it
must do nothing. Closing the connection causes a <code title="event-close">close</code> event to be fired and
the <code title="dom-WebSocket-readyState"><a href="#dom-websocket-readystate">readyState</a></code>
attribute's value to change, as <a href="#closeWebSocket">described
- below</a>.<hr><p>The following are the <span>event handler attributes</span> that
+ below</a>.<hr><p>The <dfn id="dom-websocket-bufferedamount" title="dom-WebSocket-bufferedAmount"><code>bufferedAmount</code></dfn>
+ attribute must return the number of bytes that have been queued but
+ not yet sent. If the connection is closed, this attribute's value
+ will only increase with each call to the <code title="dom-WebSocket-send"><a href="#dom-websocket-send">send()</a></code> method (the number does not
+ reset to zero once the connection closes).<hr><p>The following are the <span>event handler attributes</span> that
must be supported, as DOM attributes, by all objects implementing
the <code><a href="#websocket">WebSocket</a></code> interface:<table><thead><tr><th><span title="event handler attributes">event handler attribute</span> <th><span>Event handler event type</span>
<tbody><tr><td><dfn id="handler-websocket-onopen" title="handler-WebSocket-onopen"><code>onopen</code></dfn> <td> <code title="event-open">open</code>
Received on Tuesday, 28 July 2009 23:34:06 UTC