readyState property

dynamic get readyState

Implementation

get readyState {
  if (_ws == null) {
    return WsReadyStatus.CLOSED;
  }

  switch (_ws!.readyState) {
    case WebSocket.open:
      return WsReadyStatus.OPEN;
    case WebSocket.closed:
      return WsReadyStatus.CLOSED;
    case WebSocket.closing:
      return WsReadyStatus.CLOSING;
    case WebSocket.connecting:
      return WsReadyStatus.CONNECTING;
    default:
      return WsReadyStatus.CLOSED;
  }
}