Esempio n. 1
0
        private void WebSocketClient_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Console.WriteLine(e.Exception.GetType() + ":" + e.Exception.Message + Environment.NewLine + e.Exception.StackTrace);

            if (e.Exception.InnerException != null)
            {
                Console.WriteLine(e.Exception.InnerException.GetType());
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Event listener to be called when a wbsocket error occurs
        /// </summary>
        /// <param name="sender">The wbsocket object.</param>
        /// <param name="eventArgs">The arguments of the error event.</param>
        private static void OnError(object sender, SuperSocket.ClientEngine.ErrorEventArgs eventArgs)
        {
            mutex.Set();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine();
            Console.WriteLine(eventArgs.Exception.GetType() + ": " + eventArgs.Exception.Message);
            Console.ResetColor();
        }
Esempio n. 3
0
        protected void websocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            m_CurrentMessage = e.Exception.Message;

            if (e.Exception.InnerException != null)
            {
                m_CurrentMessage = e.Exception.InnerException.GetType().ToString();
            }
            HelperLog.Info(m_CurrentMessage);
        }
Esempio n. 4
0
        /// <summary>
        /// Occurs when a connection error happens.  This can fire if taskt server is down or not responding.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void ConnectionError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Logging.log.Info("Server Connection Error: " + e.Exception.Message);
            connectionException = e.Exception.Message;

            if (retryOnFail)
            {
                Connect(serverURI);
            }
        }
 private void WebSocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
 {
     try
     {
         this.logger?.OnException(e.Exception);
     }
     catch (Exception ex)
     {
     }
 }
 private void WebSocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
 {
     if (WebSocket.State == WebSocketState.Closed || WebSocket.State == WebSocketState.Closing)
     {
         if (!Reconnection())
         {
             ExceptionEvent?.Invoke(this, new ProviderException("websocket重连失败", e.Exception));
         }
     }
 }
Esempio n. 7
0
        /// <summary>
        /// Occurs when a connection error happens.  This can fire if taskt server is down or not responding.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void ConnectionError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            connectionException = e.Exception.Message;
            socketLogger.Information("Socket Client Connection Error: " + connectionException);

            if (retryOnFail)
            {
                reconnectTimer.Enabled = true;
            }
        }
 private void OnWsError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
 {
     if (null != m_AsyncActionQueue)
     {
         if (null != e)
         {
             m_AsyncActionQueue.QueueActionWithDelegation((MyAction <Exception>) this.OnError, e.Exception);
         }
     }
 }
        /// <summary>
        /// Occurs when a connection error happens.  This can fire if taskt server is down or not responding.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void ConnectionError(object sender, ErrorEventArgs e)
        {
            ConnectionException = e.Exception.Message;
            SocketLogger.Information("Socket Client Connection Error: " + ConnectionException);

            if (_retryOnFail)
            {
                _reconnectTimer.Enabled = true;
            }
        }
Esempio n. 10
0
        void socket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Log.WriteError("WebSocket error {0}", e.Exception.Message);

            if (DisconnectHandler != null)
            {
                DisconnectHandler();
                DisconnectHandler = null;
            }
        }
Esempio n. 11
0
        private void OnErrorCallback(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Exception exc = e.Exception;

            LoggerSystem.Instance.Error(exc.Message);

            DisConnect();

            CallbackError();
        }
Esempio n. 12
0
        private void Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Debug.Print("Battlelog Error:{0}", e.Exception.Message);
            if (m_Error == null)
            {
                return;
            }

            m_Error(this, e);
        }
Esempio n. 13
0
        private void websocketClient_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            SetMsgText(e.Exception.GetType() + ": " + e.Exception.Message + Environment.NewLine + e.Exception.StackTrace);

            if (e.Exception.InnerException != null)
            {
                SetMsgText(e.Exception.InnerException.GetType().ToString());
            }

            return;
        }
Esempio n. 14
0
 private void OnError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
 {
     if (null != e.Exception)
     {
         LogSystem.Error("LobbyNetworkSystem.OnError Exception:{0}\n{1}", e.Exception.Message, e.Exception.StackTrace);
     }
     else
     {
         LogSystem.Error("LobbyNetworkSystem.OnError (Unknown)");
     }
 }
Esempio n. 15
0
        private void websocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Console.WriteLine("WebSocket Error");
            Console.WriteLine(e.Exception.Message);
            KeepAliveTimer.Stop();

            ResetConnectionTimer           = new Timer(TimeSpan.FromSeconds(30).TotalMilliseconds); // Set the time (5 mins in this case)
            ResetConnectionTimer.AutoReset = true;
            ResetConnectionTimer.Elapsed  += new System.Timers.ElapsedEventHandler(try_reconnect);
            ResetConnectionTimer.Start();
        }
Esempio n. 16
0
        private void websocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            _log.WriteErrorAsync(
                nameof(PusherClient),
                nameof(Connection),
                nameof(ChangeState),
                e.Exception)
            .Wait();

            // TODO: What happens here? Do I need to re-connect, or do I just log the issue?
        }
 private void onWscError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
 {
     util.debugWriteLine("ms onerror");
     gotCommentList    = new List <TimeShiftCommentGetter.GotCommentInfo>();
     gotCommentListBuf = new List <TimeShiftCommentGetter.GotCommentInfo>();
     gotMinTime        = util.getUnixTime();
     gotMinXml         = new string[2];
     _gotMinTime       = util.getUnixTime();
     _gotMinXml        = new string[2];
     gotCount          = 0;
 }
Esempio n. 18
0
        private void WebSocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            //throw e.Exception;

            if (ErrorOrClosed != null)
            {
                ErrorOrClosed(sender, new ErrorOrClosedEventArgs {
                    Reason = "Error"
                });
            }
        }
        private void OnSocketError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            var evnt = Error;

            if (evnt != null)
            {
                evnt(e.Exception);
            }

            Reconnect();
        }
        void OnSocketConnectionError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Debug.WriteLine("-------------------------- SOCKET ERROR ---------------------------");
            Debug.WriteLine(e.Exception.Message);
            Debug.WriteLine("-------------------------------------------------------------------");

            if (OnError != null)
            {
                OnError(this, new EventArgs());
            }
        }
Esempio n. 21
0
        private void webSocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            this._errorMessage = e.Exception.Message;
            Console.WriteLine(this._errorMessage);
            webSocket.Close();
            webSocket.Dispose();

            //reinitialize
            WebSocketHelper wsh = new WebSocketHelper(sUrl);

            wsh.Send(this._outgoingMessage, this._aSettings);
        }
Esempio n. 22
0
        /// <summary>
        /// Handle error when try to open socket
        /// </summary>
        private void WebSocketClient_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            UnityEngine.Debug.Log(e.Exception.GetType() + ":" + e.Exception.Message + Environment.NewLine + e.Exception.StackTrace);

            if (e.Exception.InnerException != null)
            {
                UnityEngine.Debug.Log(e.Exception.InnerException.GetType());
                WSConnectDone(this, false);
                // start connecting cortex service again
                _wscTimer.Start();
            }
        }
        void wsClient_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            // log the error
            logger.ErrorFormat("websocket error happened. message[{0}]\r\nStackTrace[{1}]",
                               e.Exception.Message, e.Exception.StackTrace);

            // put the channel into Faulted state
            if ((this.openAsyncResult != null) && !this.openAsyncResult.IsCompleted)
            {
                this.openAsyncResult.Complete();
            }
            this.Fault();
        }
Esempio n. 24
0
 internal static void OnWebsocketError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
 {
     //TODO write this thing for:
     //Error in Websocket: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
     ErrorLog.Log(string.Format("Error in Websocket: " + e.Exception.Message));
     if (e.Exception.Message.Contains("A connection attempt failed because the connected party did not properly respond after a period of time"))
     {
         websocket.Close();
         Thread.Sleep(10000);
         websocket.Open();
         return;
     }
 }
Esempio n. 25
0
        private void onWscError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            util.debugWriteLine("ms onerror " + e.Exception.Message + e.Exception.Source + e.Exception.StackTrace + e.Exception.TargetSite);

            /*
             * gotCommentList = new List<TimeShiftCommentGetter.GotCommentInfo>();
             * gotCommentListBuf = new List<TimeShiftCommentGetter.GotCommentInfo>();
             * gotMinTime = util.getUnixTime();
             * gotMinXml = new string[2];
             * _gotMinTime = util.getUnixTime();
             * _gotMinXml = new string[2];
             * gotCount = 0;
             */
        }
Esempio n. 26
0
        private void websocket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            Pusher.Trace.TraceEvent(TraceEventType.Error, 0, "Error: " + e.Exception);

            if (_connectionTaskComplete != null)
            {
                _connectionTaskComplete.TrySetException(e.Exception);
            }

            if (_disconnectionTaskComplete != null)
            {
                _disconnectionTaskComplete.TrySetException(e.Exception);
            }
        }
Esempio n. 27
0
        void socket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            try
            {
                Debug.Print("Goodgame: " + e.Exception.InnerException.Message);
                if (OnError != null)
                {
                    OnError(this, new TextEventArgs(e.Exception.ToString()));
                }

                if (OnDisconnect != null)
                {
                    OnDisconnect(this, EventArgs.Empty);
                }
            }
            catch { }
        }
Esempio n. 28
0
 private void WhenError(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
 {
     Info.ErrorTimes += 1;
     CommonLog.Error("Socket Error: " + e.Exception.Message);
     if (Info.ErrorTimes <= 5)
     {
         try
         {
             Close();
         }
         catch { }
     }
     else
     {
         Info.Status = "closed";
     }
 }
Esempio n. 29
0
        private void socket_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
        {
            try
            {
                onWriteStatus(getLogTitle() + "Socket Error! reconnecting...");

                if (Constants.bRun)
                {
                    disconnect();
                    doOpenSocket();
                }
            }
            catch (Exception ex)
            {
                onWriteLog(string.Format("[{0}]{1} (socket_Error) ---> {2}", DateTime.Now.ToString(), getLogTitle(), ex.ToString()));
            }
        }
        /// <summary>
        /// Websocket error event handler.
        /// </summary>
        /// <param name="aSender">Object sending the error.</param>
        /// <param name="aEventArgs">Websocket error parameters, which contain info about the error.</param>
        private void ErrorHandler(object aSender, SuperSocket.ClientEngine.ErrorEventArgs aEventArgs)
        {
            if (_connecting)
            {
                _connectedOrFailed.TrySetResult(false);
            }

            _owningDispatcher.Send(_ =>
            {
                ErrorReceived?.Invoke(this, new ErrorEventArgs(aEventArgs.Exception));

                if (_ws?.State != WebSocketState.Open)
                {
                    Disconnect();
                }
            }, null);
        }
 private void websocket_Error(object sender, ErrorEventArgs e)
 {
     logger.Error(String.Format("Error with websocket : {0}", e.Exception.Message));
 }
Esempio n. 32
0
 /// <summary>
 ///     When something done goofed itself
 /// </summary>
 private void ConnectionError(object sender, ErrorEventArgs e)
 {
     events.GetEvent<LoginFailedEvent>().Publish(e.Exception.Message);
     AttemptReconnect();
 }
Esempio n. 33
0
		public void websocketClient_Error(object sender, ErrorEventArgs e)
		{
			Logger.Fatal("Websocket: Exception thrown: ", e.Exception);
		}
 private void OnSocketOnError(object sender, ErrorEventArgs args)
 {
     if (null != OnError) OnError(this, args);
     _logger.DebugException(args.Exception.Message, args.Exception);
 }
Esempio n. 35
0
 private void WebSocket_Error(object sender, ErrorEventArgs e)
 {
     Console.WriteLine(e.Exception);
 }
Esempio n. 36
0
 public void websocketClient_Error(object sender, ErrorEventArgs e)
 {
     Console.WriteLine("Websocket: Exception thrown: " + e.Exception.Message);
 }