aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/websocket/close
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/ja/web/api/websocket/close
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/websocket/close')
-rw-r--r--files/ja/web/api/websocket/close/index.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/files/ja/web/api/websocket/close/index.html b/files/ja/web/api/websocket/close/index.html
new file mode 100644
index 0000000000..e81076b85a
--- /dev/null
+++ b/files/ja/web/api/websocket/close/index.html
@@ -0,0 +1,58 @@
+---
+title: WebSocket.close()
+slug: Web/API/WebSocket/close
+translation_of: Web/API/WebSocket/close
+---
+<p>{{APIRef("Web Sockets API")}}</p>
+
+<p><strong><code>WebSocket.close()</code></strong> メソッドは、{{domxref("WebSocket")}} の接続、もしくは接続試行(存在した場合)を閉じます。接続がすでに <code>CLOSED</code> だった場合、このメソッドは何もしません。</p>
+
+<h2 id="構文">構文</h2>
+
+<pre class="syntaxbox notranslate">WebSocket.close();</pre>
+
+<h3 id="引数">引数</h3>
+
+<dl>
+ <dt><code>code</code> {{optional_inline}}</dt>
+ <dd>接続が閉じられている理由を説明するためのステータスコードを示す数値を指定します。このパラメータを指定しない場合、デフォルト値として 1005 が指定されます。許可されている値については{{domxref("CloseEvent")}}の<a href="/ja/docs/Web/API/CloseEvent">ステータスコードの一覧</a>を参照してください。</dd>
+ <dt><code>reason</code> {{optional_inline}}</dt>
+ <dd>接続が閉じられている理由を説明するための人間が読める文字列を指定します。この文字列は UTF-8 テキスト (文字<strong>ではありません</strong>) で 123 バイトを超えていけません。</dd>
+</dl>
+
+<h3 id="投げられる例外">投げられる例外</h3>
+
+<dl>
+ <dt><code>INVALID_ACCESS_ERR</code></dt>
+ <dd>無効な <code>code</code> が指定された場合</dd>
+ <dt><code>SYNTAX_ERR</code></dt>
+ <dd><code>reason</code> に指定した文字列が長すぎるか、ペアリングされていないサロゲートを含んでいる場合</dd>
+</dl>
+
+<div class="note">
+<p><strong>注意:</strong> Gecko において、Gecko 8.0 {{geckoRelease("8.0")}} 以前は、このメソッドはいづれのパラメータもサポートしていませんでした。</p>
+</div>
+
+<h2 id="仕様書">仕様書</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th>仕様書</th>
+ <th>状態</th>
+ <th>備考</th>
+ </tr>
+ <tr>
+ <td><a class="external external-icon" href="https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket-close" hreflang="en" lang="en">HTML Living Standard<br>
+ <small lang="en-US">The definition of 'WebSocket.close()' in that specification.</small></a></td>
+ <td><span class="spec-Living">Living Standard</span></td>
+ <td>初回定義</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="ブラウザの互換性">ブラウザの互換性</h2>
+
+
+
+<p>{{Compat("api.WebSocket.close")}}</p>