From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/websocket/close/index.html | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 files/ja/web/api/websocket/close/index.html (limited to 'files/ja/web/api/websocket/close') 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 +--- +

{{APIRef("Web Sockets API")}}

+ +

WebSocket.close() メソッドは、{{domxref("WebSocket")}} の接続、もしくは接続試行(存在した場合)を閉じます。接続がすでに CLOSED だった場合、このメソッドは何もしません。

+ +

構文

+ +
WebSocket.close();
+ +

引数

+ +
+
code {{optional_inline}}
+
接続が閉じられている理由を説明するためのステータスコードを示す数値を指定します。このパラメータを指定しない場合、デフォルト値として 1005 が指定されます。許可されている値については{{domxref("CloseEvent")}}のステータスコードの一覧を参照してください。
+
reason {{optional_inline}}
+
接続が閉じられている理由を説明するための人間が読める文字列を指定します。この文字列は UTF-8 テキスト (文字ではありません) で 123 バイトを超えていけません。
+
+ +

投げられる例外

+ +
+
INVALID_ACCESS_ERR
+
無効な code が指定された場合
+
SYNTAX_ERR
+
reason に指定した文字列が長すぎるか、ペアリングされていないサロゲートを含んでいる場合
+
+ +
+

注意: Gecko において、Gecko 8.0 {{geckoRelease("8.0")}} 以前は、このメソッドはいづれのパラメータもサポートしていませんでした。

+
+ +

仕様書

+ + + + + + + + + + + + + + +
仕様書状態備考
HTML Living Standard
+ The definition of 'WebSocket.close()' in that specification.
Living Standard初回定義
+ +

ブラウザの互換性

+ + + +

{{Compat("api.WebSocket.close")}}

-- cgit v1.2.3-54-g00ecf