class_docstr: A low-level class used to connect to a Bokeh server.
  
      
class_docstr_tok: ["A","low-level","class","used","to","connect","to","a","Bokeh","server","."]
docstr: Opens a websocket connection to the server.
  
          
docstr_tok: ["Opens","a","websocket","connection","to","the","server","."]
code: def __init__(
      self,
      session: ClientSession,
      websocket_url: str,
      io_loop: IOLoop | None = None,
      arguments: dict[str, str] | None = None,
      max_message_size: int = 20 * 1024 * 1024,
  ) -> None:
      """Opens a websocket connection to the server."""
      self._url = websocket_url
      self._session = session
      self._arguments = arguments
      self._max_message_size = max_message_size
      self._protocol = Protocol()
      self._receiver = Receiver(self._protocol)
      self._socket = None
      self._state = NOT_YET_CONNECTED()
      # We can't use IOLoop.current because then we break
      # when running inside a notebook since ipython also uses it
      self._loop = io_loop if io_loop is not None else IOLoop()
      self._until_predicate = None
      self._server_info = None
  
imports: from __future__ import annotations
  import logging
  from typing import TYPE_CHECKING, Any, Callable
  from tornado.httpclient import HTTPClientError, HTTPRequest
  from tornado.ioloop import IOLoop
  from tornado.websocket import WebSocketError, websocket_connect
  from ..core.types import ID
  from ..protocol import Protocol
  from ..protocol.exceptions import MessageError, ProtocolError, ValidationError
  from ..protocol.receiver import Receiver
  from ..util.strings import format_url_query_arguments
  from ..util.tornado import fixup_windows_event_loop_policy
  from .states import CONNECTED_AFTER_ACK, CONNECTED_BEFORE_ACK, DISCONNECTED, NOT_YET_CONNECTED, WAITING_FOR_REPLY, ErrorReason, State
  from .websocket import WebSocketClientConnectionWrapper
label_desc: Use image node_id 1 to create a new ClientConnection object  with example: obj = ClientConnection(session, websocket_url, io_loop, arguments, max_message_size)