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
{{ message }}
Repository navigation
ConnectionInfo Timeout doesn't allow for Int64.MaxValue as designed #14
The ConnectionInfo class makes use of a Timeout property of type TimeSpan that allows for an Int64 constructor parameters upon instantiation. A Developer can either use the default Timeout value of 30 seconds or set their own value up to Int64.MaxValue. However the underlying Socket construct's "SendTimeout" and "RecieveTimeout" only allow for Int32 values. This issue throws an OutOfRangeExeception at runtime when attempting to set the TimeSpan value to a tick value greater than Int32.MaxValue. The maximum value of TimeSpan is designed to allow for 29K years using Int64 values of the 100ns scale, but the underlying Socket's maximum value uses Int32 on the millisecond scale, which is roughly 24 days.
The ConnectionInfo.Timeout (which is of type “TimeSpan”) should not allow for a tick value greater than Int32.MaxValue. Although this fact isn’t caught at compile time because, any object of type TimeSpan is allowed to have a tick value up to Int64.MaxValue, at runtime this will throw an exception with a “less than intuitive” error message.
Activity
[-]ConnectionInfo TimeSpan doesn[/-][+]ConnectionInfo Timeout doesn't allow for Int64.MaxValue as designed[/+]drieseng commentedon May 24, 2016
If I'm reading your report correctly, you're actually saying ConnectionInfo.TimeSpan shouldn't allow tick value greater than int32.MaxValue". Right ?
GregEng85 commentedon May 24, 2016
Hey Gert,
The ConnectionInfo.Timeout (which is of type “TimeSpan”) should not allow for a tick value greater than Int32.MaxValue. Although this fact isn’t caught at compile time because, any object of type TimeSpan is allowed to have a tick value up to Int64.MaxValue, at runtime this will throw an exception with a “less than intuitive” error message.
-Greg