/// <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; }
/// <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; }
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; }
/// <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; }
/// <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; }
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; }