I'm not sure if that definition of 0 is good. It would be more natural to use 0 as "disable retry feature", and a high value (MaxInt, no special value is needed) as no limit.