WebSocket: readyState プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
WebSocket.readyState
は読み取り専用のプロパティで、 WebSocket
の「現在」の接続状態を返します。
値
以下のいずれかの unsigned short
値です。
値 | 状態 | 説明 |
---|---|---|
0 |
CONNECTING |
ソケットの作成が完了した。コネクションは開かれていない。 |
1 |
OPEN |
コネクションが開かれ、通信の準備ができている。 |
2 |
CLOSING |
コネクションが閉じる過程にある。 |
3 |
CLOSED |
コネクションが閉じられたか、開くことができなかった。 |
仕様書
Specification |
---|
WebSockets # ref-for-dom-websocket-readystate① |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
readyState |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.