Example #1
0
 /// <summary>
 /// Contructor for a Backoff object.
 /// </summary>
 /// <param name="Speed">The <see cref="BackoffSpeed"/> that will be used for this instance</param>
 /// <param name="MaxDelay">The maximum delay in milliseconds</param>
 public Backoff(BackoffSpeed Speed, int MaxDelay)
 {
     if (MaxDelay <= 0)
     {
         throw new ArgumentOutOfRangeException("MaxDelay", "must be greater than zero");
     }
     attempts = 0;
     maxDelay = MaxDelay;
     speed    = Speed;
 }
Example #2
0
 /// <summary>
 /// Contructor for a Backoff object, sets the Maximum Delay to 10 min.
 /// </summary>
 /// <param name="Speed">The <see cref="BackoffSpeed"/> that will be used for this instance</param>
 public Backoff(BackoffSpeed Speed)
 {
     attempts = 0;
     maxDelay = 600000;
     speed    = Speed;
 }
Example #3
0
        private int maxDelay;         //Maximum delay - by default set to 10 minutes

        #endregion

        #region Public Constructors

        /// <summary>
        /// Default contructor for a Backoff object. It sets the <see cref="BackoffSpeed"/>
        /// to Linear and the Maximum Delay to 10 minutes.
        /// </summary>
        public Backoff()
        {
            attempts = 0;
            maxDelay = 600000;
            speed    = BackoffSpeed.Linear;
        }
Example #4
0
 /// <summary>
 /// Contructor for a Backoff object, sets the <see cref="BackoffSpeed"/> to Linear.
 /// </summary>
 /// <param name="MaxDelay">The maximum delay that must be returned by the <see cref="Next"/> method, in milliseconds.</param>
 public Backoff(int MaxDelay)
 {
     if(MaxDelay <= 0)
     {
         throw new ArgumentOutOfRangeException("MaxDelay", "must be greater than zero");
     }
     attempts=0;
     maxDelay=MaxDelay;
     speed=BackoffSpeed.Linear;
 }
Example #5
0
 /// <summary>
 /// Contructor for a Backoff object, sets the Maximum Delay to 10 min.
 /// </summary>
 /// <param name="Speed">The <see cref="BackoffSpeed"/> that will be used for this instance</param>
 public Backoff(BackoffSpeed Speed)
 {
     attempts=0;
     maxDelay=600000;
     speed=Speed;
 }
Example #6
0
        private BackoffSpeed speed; //the function to be used for the delay calculation

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Default contructor for a Backoff object. It sets the <see cref="BackoffSpeed"/>
        /// to Linear and the Maximum Delay to 10 minutes.
        /// </summary>
        public Backoff()
        {
            attempts=0;
            maxDelay=600000;
            speed=BackoffSpeed.Linear;
        }