コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: unnivm/jwebsocket
 public void ProcessOnError(WebSocketErrorEventArgs aError)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         StatusList.Items.Add("Error: " + aError.Message);
     });
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 private void Error(object sender, WebSocketErrorEventArgs e)
 {
     Console.WriteLine("Error: " + e.Exception.Message);
 }
コード例 #5
0
 protected virtual void OnWebSocketError(object sender, WebSocketErrorEventArgs e)
 {
     Debug.LogError("FTL socket error: " + e.Message);
     DisconnectWebSocket();
 }
コード例 #6
0
 protected override void OnWebSocketError(object sender, WebSocketErrorEventArgs e)
 {
     Debug.LogError("Web socket error: " + e.Message);
     DisconnectWebSocket();
 }
コード例 #7
0
ファイル: RosConnector.cs プロジェクト: w1211/ROSReality
 protected override void OnWebSocketError(object sender, WebSocketErrorEventArgs e)
 {
     TextToSpeechManager.Instance.websocketError();
     Debug.LogError("Web socket error: " + e.Message);
     DisconnectWebSocket();
 }