WebSocket.readyState
읽기 전용 속성은 WebSocket
연결의 현재 상태를 반환한다.
Syntax
var readyState = aWebSocket.readyState;
Value
아래의 unsigned short
값들 중 하나 :
Value | State | Description |
0 |
CONNECTING |
소켓이 생성되었다. 연결이 아직 열려 있지 않다. |
1 |
OPEN |
연결이 열려 있고, 통신할 준비가 되었다. |
2 |
CLOSING |
연결이 닫히는 중이다. |
3 |
CLOSED |
연결이 닫혔거나 열 수 없었다. |
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'WebSocket: readyState' in that specification. |
Living Standard | Initial definition |
Browser compatibility
BCD tables only load in the browser