Skip to content

ConnectionInfo Timeout doesn't allow for Int64.MaxValue as designed #14

Closed

Description

@GregEng85

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.

Activity

  1. changed the title [-]ConnectionInfo TimeSpan doesn[/-] [+]ConnectionInfo Timeout doesn't allow for Int64.MaxValue as designed[/+] on May 23, 2016
  2. drieseng commented on May 24, 2016

    @drieseng
    Member

    If I'm reading your report correctly, you're actually saying ConnectionInfo.TimeSpan shouldn't allow tick value greater than int32.MaxValue". Right ?

  3. GregEng85 commented on May 24, 2016

    @GregEng85
    Author

    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

    On May 24, 2016, at 3:07 PM, Gert Driesen [email protected] wrote:

    If I'm reading your report correctly, you're actually saying ConnectionInfo.TimeSpan shouldn't allow tick value greater than int32.MaxValue". Right ?

    —
    You are receiving this because you authored the thread.
    Reply to this email directly or view it on GitHub #14 (comment)

  4. added this to the 2024.0.0 milestone on Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions