예제 #1
0
        public void HandleMainLoopException(ShutdownEventArgs reason)
        {
            if (!SetCloseReason(reason))
            {
                LogCloseError("Unexpected Main Loop Exception while closing: "
                              + reason, new Exception(reason.ToString()));
                return;
            }

            OnShutdown();
            LogCloseError("Unexpected connection closure: " + reason, new Exception(reason.ToString()));
        }
예제 #2
0
 private void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e)
 {
     Debug.Log("ElmoGameNetwork: Disconnected: " + e.ToString());
     DoMainThread.ExecuteOnMainThread(() => {
         OnDesconnected?.Invoke();
     });
     // ForceToReconnect();
 }
예제 #3
0
        private void OnConsumerShutdown(object sender, ShutdownEventArgs e)
        {
            var args = new LogMessageEventArgs
            {
                LogType = MqLogType.ConsumerShutdown,
                Reason  = e.ToString()
            };

            OnLog?.Invoke(sender, args);
        }
예제 #4
0
 void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e)
 {
     if (e.Initiator == ShutdownInitiator.Application && e.ReplyCode == 200)
     {
         connectionShutdownCompleted?.TrySetResult(true);
     }
     else
     {
         circuitBreaker.Failure(new Exception(e.ToString()));
     }
 }
예제 #5
0
        private void _connection_ConnectionShutdown(IConnection connection, ShutdownEventArgs reason)
        {
            CloseConnection();
            var msg = "发生端connection连接断开";

            if (reason != null)
            {
                msg += ",reason:" + reason.ToString();
            }
            Log.Error(msg);
        }
예제 #6
0
        private void _channnel_ModelShutdown(IModel model, ShutdownEventArgs reason)
        {
            CloseConnection();
            var msg = "发生端channel连接断开";

            if (reason != null)
            {
                msg += ",reason:" + reason.ToString();
            }
            Log.Error(msg);
        }
 void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e)
 {
     if (e.Initiator == ShutdownInitiator.Application && e.ReplyCode == 200)
     {
         connectionShutdownCompleted?.TrySetResult(true);
     }
     else if (circuitBreaker.Disarmed)
     {
         //log entry handled by event handler registered in ConnectionFactory
         circuitBreaker.Failure(new Exception(e.ToString()));
         _ = Task.Run(() => Reconnect());
     }
     else
     {
         Logger.WarnFormat("'{0}' connection shutdown while reconnect already in progress: {1}", name, e);
     }
 }
        void Channel_ModelShutdown(object sender, ShutdownEventArgs e)
        {
            if (e.Initiator == ShutdownInitiator.Application)
            {
                return;
            }

            if (e.Initiator == ShutdownInitiator.Peer && e.ReplyCode == 404)
            {
                return;
            }

            if (circuitBreaker.Disarmed)
            {
                Logger.WarnFormat("'{0}' channel shutdown: {1}", name, e);
                circuitBreaker.Failure(new Exception(e.ToString()));
                _ = Task.Run(() => Reconnect());
            }
            else
            {
                Logger.WarnFormat("'{0}' channel shutdown while reconnect already in progress: {1}", name, e);
            }
        }
예제 #9
0
 public override void HandleModelShutdown(object Model, ShutdownEventArgs Reason)
 {
     lock (queue)
         AddToExceptionText(Reason.ToString());
     base.HandleModelShutdown(Model, Reason);
 }
예제 #10
0
 /// <summary>
 /// Channel關閉
 /// </summary>
 /// <param name="model"></param>
 /// <param name="reason"></param>
 private void Channel_ModelShutdown(object model, ShutdownEventArgs reason)
 {
     Console.WriteLine("CHANNEL__MODEL_SHUTDOWN " + reason.ToString());
 }
예제 #11
0
 /// <summary>
 /// Channel關閉
 /// </summary>
 /// <param name="model"></param>
 /// <param name="reason"></param>
 private void Channel_ModelShutdown(object model, ShutdownEventArgs reason)
 {
     //logger.Info($"{DateTime.Now} Info: CHANNEL__MODEL_SHUTDOWN。 model= {model} Message: {reason.Cause}");
     Console.WriteLine("CHANNEL__MODEL_SHUTDOWN " + reason.ToString());
 }
예제 #12
0
 private void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e)
 {
     _logger.LogWarning(e.ToString());
 }
예제 #13
0
 private void ShutdownEvent(object model, ShutdownEventArgs shutdownEventArgs)
 {
     logger.LogWarning("ShutdownEvent:{shutdownEventArgs}", shutdownEventArgs.ToString());
 }
예제 #14
0
 private static void SubscriptionShutdown(object sender, ShutdownEventArgs e)
 {
     Log.Error("SubscriptionShutdown: {0}", e.ToString());
 }
예제 #15
0
 public override string ToString()
 {
     return(_args.ToString());
 }
예제 #16
0
 /// <summary>
 /// on channel shutdown
 /// </summary>
 /// <param name="model"></param>
 /// <param name="reason"></param>
 public override void HandleModelShutdown(object model, ShutdownEventArgs reason)
 {
     base.HandleModelShutdown(model, reason);
     this.ReListen();
     Trace.TraceError(reason.ToString());
 }
예제 #17
0
 public void OnShutDown(ShutdownEventArgs args)
 {
     _logger?.LogDebug("OnShutDown for connection: {args}", args.ToString());
 }
예제 #18
0
        public void HandleMainLoopException(ShutdownEventArgs reason)
        {
            if (!SetCloseReason(reason))
            {
                LogCloseError("Unexpected Main Loop Exception while closing: "
                              + reason, new Exception(reason.ToString()));
                return;
            }

            OnShutdown();
            LogCloseError("Unexpected connection closure: " + reason, new Exception(reason.ToString()));
        }
예제 #19
0
 private void Conn_ConnectionShutdown(object sender, ShutdownEventArgs e)
 {
     logger.LogInformation($"Conn_ConnectionShutdown - {sender.ToString()} : {e.ToString()}");
 }