Skip to content

Conversation

kevincathcart-cas
Copy link
Contributor

Summary

This fixes the exception documentation for SocketsHttpHandler.PooledConnectionLifetime

The documentation currently reads:

Exceptions

ArgumentOutOfRangeException
The value specified is less than Zero or is equal to InfiniteTimeSpan.

However, the code is:

        public TimeSpan PooledConnectionIdleTimeout
        {
            get => _settings._pooledConnectionIdleTimeout;
            set
            {
                if (value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan)
                {
                    throw new ArgumentOutOfRangeException(nameof(value));
                }

                CheckDisposedOrStarted();
                _settings._pooledConnectionIdleTimeout = value;
            }
        }

So InfiniteTimeSpan is allowed, which makes sense given that it is documented as the default.

So updated to reflect the code, matching the verbiage from PooledConnectionIdleTimeout, which has a nearly identical implementation.

The only thing I have not verified is if the old message was valid for past versions, but it seems unlikely.

@kevincathcart-cas kevincathcart-cas requested a review from a team as a code owner March 13, 2024 21:53
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 13, 2024
@ghost ghost added the area-System.Net.Http label Mar 13, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl

Copy link

Learn Build status updates of commit 2e409c1:

✅ Validation status: passed

File Status Preview URL Details
xml/System.Net.Http/SocketsHttpHandler.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@gewarren gewarren enabled auto-merge (squash) September 22, 2025 23:33
@gewarren gewarren merged commit 0aba5f0 into dotnet:main Sep 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net.Http community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants