WebSocketReadyState

TWebSocketReadyState
Bun

Symbol

WebSocketReadyState

type WebSocketReadyState = 0 | 1 | 2 | 3

A state that represents if a WebSocket is connected.

  • WebSocket.CONNECTING is 0, the connection is pending.
  • WebSocket.OPEN is 1, the connection is established and send() is possible.
  • WebSocket.CLOSING is 2, the connection is closing.
  • WebSocket.CLOSED is 3, the connection is closed or couldn't be opened.