示例#1
0
        internal void StartHeartBeat()
        {
            if (IsQSenderReadyForHB)
            {
                return;
            }
            IsQSenderReadyForHB = true;
            if (MyTSMHistory == null)
            {
                MyTSMHistory = new TheMirrorCache <TheSentRegistryItem>(TheBaseAssets.MyServiceHostInfo.TO.QSenderDejaSentTime);
            }

            if (!TheBaseAssets.MyServiceHostInfo.UseHBTimerPerSender)
            {
                TheQueuedSenderRegistry.RegisterHBTimer(sinkHeartBeatTimer);
            }
            else
            {
                lock (lockStartLock)
                {
                    if (mMyHeartBeatTimer == null)
                    {
                        mMyHeartBeatTimer = new Timer(sinkHeartBeatTimerLocal, null, TheBaseAssets.MyServiceHostInfo.TO.QSenderHealthTime, TheBaseAssets.MyServiceHostInfo.TO.QSenderHealthTime);
                    }
                }
            }
            InitHeartbeatTimer();
        }