WebSocket.readyState
read-only property returns the current state of the
WebSocket
连接。
var readyState = aWebSocket.readyState;
One of the following
unsigned short
值:
| 值 | 状态 | 描述 |
0
|
CONNECTING
|
Socket has been created. The connection is not yet open. |
1
|
OPEN
|
The connection is open and ready to communicate. |
2
|
CLOSING
|
The connection is in the process of closing. |
3
|
CLOSED
|
The connection is closed or couldn't be opened. |
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'WebSocket: readyState' in that specification. |
实时标准 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
readyState
|
Chrome 43 | Edge 12 | Firefox 19 | IE 10 | Opera 30 | Safari 10 | WebView Android 43 | Chrome Android 43 | Firefox Android 19 | Opera Android 30 | Safari iOS 10 | Samsung Internet Android 4.0 |
完整支持
WebSocket
binaryType
bufferedAmount
extensions
onclose
onerror
onmessage
onopen
协议
readyState
url