Пример #1
0
 protected void _OnWorkerSuccess(){
     this.currentRetries = 0;
     this.WorkerSuccess(this.frame.index);
     this.frame = null;
     if (this.monitorTimer != null)
     {
         this.monitorTimer.Start();
     }
 }
Пример #2
0
        public void _Run(Object source, ElapsedEventArgs e)
        {
            
            if (this.frame == null)
            {
                this.frame = this.session.getNext();
            }

            if (this.frame == null)
            {
                return;
            }

            this.monitorTimer.Stop();

            if (this.currentRetries > this.maxRetries)
            {
                this.session.Requeue(this.frame);
                this.frame = null;
                this.WorkerError();
                return;
            }

            try
            {
                this._Send();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Send failed retry {0}...", this.currentRetries);
                this.currentRetries++;
                if (this.monitorTimer != null)
                {
                    this.monitorTimer.Start();
                }
            }
        }