'Opens a websocket connection to the server.'

def __init__(self, session, websocket_url, io_loop=None):

    self._url = websocket_url
    self._session = session
    self._protocol = Protocol('1.0')
    self._receiver = Receiver(self._protocol)
    self._socket = None
    self._state = self.NOT_YET_CONNECTED()
    if (io_loop is None):
        io_loop = IOLoop()
    self._loop = io_loop
    self._until_predicate = None
    self._protocol = Protocol('1.0')
    self._server_info = None
