public void ProcessOnError(WebSocketErrorEventArgs aError) { Deployment.Current.Dispatcher.BeginInvoke(() => { StatusList.Items.Add("Error: " + aError.Message); }); }
private void OnError(object client, WebSocketErrorEventArgs e) { if (!_client.IsConnected) { _pingTimer?.Dispose(); _pingTimer = null; // Try to make reconnection Task.Factory.StartNew(async() => { await _client.ReconnectAsync().ConfigureAwait(false); }, TaskCreationOptions.RunContinuationsAsynchronously); LogError(e.Message, ChatError.InvalidConnection); } }
public async Task ShouldNotHaveStrayErrorEvents() { var frameReceivedTcs = new TaskCompletionSource <bool>(); WebSocketErrorEventArgs socketError = null; IWebSocket ws = null; Page.WebSocket += (_, e) => { ws = e.WebSocket; e.WebSocket.SocketError += (_, e) => socketError = e; e.WebSocket.FrameReceived += (_, e) => frameReceivedTcs.TrySetResult(true); }; await TaskUtils.WhenAll( frameReceivedTcs.Task, Page.EvaluateAsync(@"port => { window.ws = new WebSocket('ws://localhost:' + port + '/ws'); }", TestConstants.Port)); await Page.EvaluateAsync("window.ws.close();"); Assert.Null(socketError); }
private void Error(object sender, WebSocketErrorEventArgs e) { Console.WriteLine("Error: " + e.Exception.Message); }
protected virtual void OnWebSocketError(object sender, WebSocketErrorEventArgs e) { Debug.LogError("FTL socket error: " + e.Message); DisconnectWebSocket(); }
protected override void OnWebSocketError(object sender, WebSocketErrorEventArgs e) { Debug.LogError("Web socket error: " + e.Message); DisconnectWebSocket(); }
protected override void OnWebSocketError(object sender, WebSocketErrorEventArgs e) { TextToSpeechManager.Instance.websocketError(); Debug.LogError("Web socket error: " + e.Message); DisconnectWebSocket(); }