Cgw.Channel.MonitorChannelManager.DisableChannel C# (CSharp) Method

DisableChannel() public method

失效通道
public DisableChannel ( string channelLabel ) : void
channelLabel string
return void
        public void DisableChannel(string channelLabel)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);

            try
            {
                bool successed = this.channelDicLocker.TryEnterReadLock(CgwConst.ENTER_LOCK_WAIT_TIME);
                // 申请互斥
                if (successed)
                {
                    try
                    {
                        if (this.monitorChannelDic.ContainsKey(channelLabel))
                        {
                            this.monitorChannelDic[channelLabel].Disable();
                        }
                        else
                        {
                            logEx.Warn("DisableChannel can't find channel label={0}.", channelLabel);
                        }
                    }
                    finally
                    {
                        // 释放互斥量
                        this.channelDicLocker.ExitReadLock();
                    }
                }
                else
                {
                    // 日志
                    logEx.Error("DisableChannel: Enert Write Lock Failed.WaitingReadCount:{0};WaitingWriteCount:{1}.", this.channelDicLocker.WaitingReadCount, this.channelDicLocker.WaitingWriteCount);
                }
            }
            catch (Exception ex)
            {
                // 日志
                logEx.Error(ex, "DisableChannel: Enert Write Lock Exception.");
            }
        }