changed reconnect from milliseconds to seconds, improved reconnect attempt#252
Conversation
…ness in reconnect attempt
|
I really appreciate that you tried to do something good (in your opinion) but unfortunately I don't agree with these changes |
|
@DragonzMaster Be sure to always give constructive criticism. Code LogicPlease correct my mistakes |
|
I truthfully like the milliseconds unit. My reasons would be that it is consistent with the rest of the code, and also because we will normally dealing with seconds that may have more accuracy to them. Though it will likely get up to a few seconds, we normally will be dealing with fractions of a second. :) |
|
OK I will the next time, Sorry 😄 @yankejustin |
|
@yankejustin sorry I missed your question. Your math is mixing scale, you have 300,000 milliseconds, not seconds. The connection retry times should honestly never be as fast as a few seconds, they show up too easily on scanners. Even once per 60 seconds is still much too fast. I did not hear anyone make an argument for setting the connection retry time to less than 1 second, which is the only reason for millisecond precision, and milliseconds just make the values intuitive for the user, nobody whats to put count zeros to make sure 300000 is the right value. |
|
We'll keep it at milliseconds. |
I changed the reconnect delay from milliseconds to seconds. The builder form label changed to "seconds" and the client now multiplies the reconnect delay by 1000 to convert it to milliseconds. I modified the defaults for debug to be 1 second and for production to be 300 seconds, or 5 minutes. The previous value of 5 seconds created a much too obvious rapidly polling outgoing connection.
Additionally I modified the randomness in the reconnect timeout to always be between 50% and 150% of the configured value, allowing for a better randomly staggered reconnect time that is less likely to show up as a simple recurring pattern. If you use the 5 minute default that I set then the retry time will be between 2.5 minutes and 7.5 minutes.