aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/websocket/bufferedamount
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/websocket/bufferedamount
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/websocket/bufferedamount')
-rw-r--r--files/zh-cn/web/api/websocket/bufferedamount/index.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/websocket/bufferedamount/index.html b/files/zh-cn/web/api/websocket/bufferedamount/index.html
new file mode 100644
index 0000000000..4162fa92f2
--- /dev/null
+++ b/files/zh-cn/web/api/websocket/bufferedamount/index.html
@@ -0,0 +1,49 @@
+---
+title: WebSocket.bufferedAmount
+slug: Web/API/WebSocket/bufferedAmount
+tags:
+ - API
+ - Property
+ - Reference
+ - Web API
+ - WebSocket
+translation_of: Web/API/WebSocket/bufferedAmount
+---
+<p>{{APIRef("Web Sockets API")}}</p>
+
+<p><strong><code>WebSocket.bufferedAmount</code>是一个只读属性,用于返回已经被</strong>{{manch("send")}}方法放入队列中但还没有被发送到网络中的数据的字节数。一旦队列中的所有数据被发送至网络,则该属性值将被重置为0。但是,若在发送过程中连接被关闭,则属性值不会重置为0。如果你不断地调用{{manch("send")}},则该属性值会持续增长</p>
+
+<p>The <strong><code>WebSocket.bufferedAmount</code></strong> read-only property returns the number of bytes of data that have been queued using calls to {{manch("send")}} but not yet transmitted to the network. This value resets to zero once all queued data has been sent. This value does not reset to zero when the connection is closed; if you keep calling {{manch("send")}}, this will continue to climb.</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox"><em>var bufferedAmount</em> = aWebSocket.bufferedAmount;</pre>
+
+<h2 id="Value">Value</h2>
+
+<p>An <code>unsigned long</code>.</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', '#dom-websocket-bufferedamount', 'WebSocket: bufferedAmount')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("api.WebSocket.bufferedAmount")}}</p>