private async Task ConnectAndHandleConnection()
        {
            await PerformConnect(_disconnectToken);

            var linkedToken = CreateLinkedCancellationToken();
            await _webSocketHandler.ProcessWebSocketRequestAsync(_webSocket, linkedToken);
        }
        private async Task PerformConnect(string url)
        {
            var uri = UrlBuilder.ConvertToWebSocketUri(url);

            _connection.Trace(TraceLevels.Events, "WS Connecting to: {0}", uri);

            // TODO: Revisit thread safety of this assignment
            _webSocketTokenSource = new CancellationTokenSource();
            _webSocket            = new ClientWebSocket();

            _connection.PrepareRequest(new WebSocketWrapperRequest(_webSocket, _connection));

            CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_webSocketTokenSource.Token, _disconnectToken);
            CancellationToken       token     = linkedCts.Token;

            await _webSocket.ConnectAsync(uri, token);

            await _webSocketHandler.ProcessWebSocketRequestAsync(_webSocket, token);
        }