Esempio n. 1
0
        private void websocket_Closed(object sender, EventArgs e)
        {
            Console.WriteLine("Connection Closed...");
            OnWebSocketClosedEvent?.Invoke();

            string ClosedMessage = DateTime.Now.ToString();

            IsConnected = true;
            Thread.Sleep(2000);
            this.Start();
            IsReconnect = true;
        }
Esempio n. 2
0
        private void websocket_Closed(object sender, EventArgs e)
        {
            Console.WriteLine("Connection Closed...");
            OnWebSocketClosedEvent?.Invoke();

            string ClosedMessage = DateTime.Now.ToString();

            IsConnected = true;
            Thread.Sleep(2000);
            this.Start();
            // Reconnect logic...
            IsReconnect = true;
            //DispatcherRef.BeginInvoke( new Action(
            //delegate
            //{
            //	new OneShotTimer( 750, ReStart, ClosedMessage );
            //} ) );
        }
Esempio n. 3
0
        private void websocket_Closed(object sender, EventArgs e)
        {
            try
            {
                FireOnTextInfoEvent($"{PGStatus.ClusterName} Connection Closed...");
                OnWebSocketClosedEvent?.Invoke(PGStatus.ClusterName);

                string ClosedMessage = DateTime.Now.ToString();
                PGStatus.IsConnected = false;

                // Reconnect logic...
                if (PGStatus.AutoReconnect && PGStatus.IsAuthorized &&
                    !PGStatus.IsTerminate && !PGStatus.IsAuthFailed)
                {
                    ReStart(ClosedMessage);
                }
            }
            catch (Exception ex)
            {
                string ErrorMessage = $"websocket_Closed(): {ex.Message}";
            }
        }