Beispiel #1
0
        public static bool IsListensServiceError(this PublisherListen item)
        {
            /*
             * 检测服务器是否出现异常
             */

            bool result = false;

            if (checkDate(item.SendDate))
            {
                if (item.ReplyDate != null)
                {
                    if (checkDate(item.SendDate))
                    {
                        result = true;
                    }
                }
                result = true;
            }
            if (result && item.SendWebClientDate != null)
            {
                var minutes = (DateTime.Now - (DateTime)item.SendWebClientDate).Minutes;
                if (minutes < NetmqOptions.ServiceErrorSendClientMinutes)
                {
                    result = false;
                }
            }
            return(result);
        }
Beispiel #2
0
        public static bool IsSendListens(this PublisherListen item)
        {
            /*
             * 如果状态是未发送
             * 判断对未收到反馈消息的发送命令进行处理再次发送
             * 发送间隔超过 10s 发送次数>4
             */
            if (item.IsSend)
            {
                return(false);
            }
            if (item.SendCount > 4)
            {
                return(false);
            }
            var seconds = (DateTime.Now - item.SendDate).Seconds;

            if (seconds < NetmqOptions.PolicySendSeconds)
            {
                return(false);
            }
            return(true);
        }