You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because Environment.TickCount returns values from Int32.MinValue to Int32.MaxValue. Therefore, if the system has been running for 24.9 days, the counter will turn negative and the expression Expired = Environment.TickCount-Elapsed > Timeout will return false for the next 24.9 days.
Instead of Environment.TickCount, I would suggest using a static instance of Stopwatch (which is run once) to get uptime milliseconds.
The text was updated successfully, but these errors were encountered:
This method would cause a single transmission error if the TickCount overflows exactly while waiting for data and I think any application resilient enough will keep working anyway.
Honestly I use sharp7 in many application that runs in high frequency polling over many years and I didn't get any problem at this point.
I understand the problem, I will fix it.
Thank you for your suggestion.
Hello!
We are using an implementation for C# and I would like to draw your attention to the following code:
This is because Environment.TickCount returns values from Int32.MinValue to Int32.MaxValue. Therefore, if the system has been running for 24.9 days, the counter will turn negative and the expression Expired = Environment.TickCount-Elapsed > Timeout will return false for the next 24.9 days.
Instead of Environment.TickCount, I would suggest using a static instance of Stopwatch (which is run once) to get uptime milliseconds.
The text was updated successfully, but these errors were encountered: