Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HttpWebRequest.ReadWriteTimeout #47648

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

stephentoub
Copy link
Member

Uses the recently added support for SocketsHttpHandler.ConnectCallback to be used for synchronous operations (#45300) to add support for HttpWebRequest.ReadWriteTimeout. That value is now used to set the Read/WriteTimeout on the underlying socket, with it then affecting all synchronous reads and writes on that connection. The ReadWriteTimeout is added to the cache key for whether the cached HttpClient instance can be used, as is whether the request is sync or async because that influences how connections are created from the HttpClient instance.

Fixes #43520

A couple of notes:

Uses the recently added support for SocketsHttpHandler.ConnectCallback to be used for synchronous operations to add support for HttpWebRequest.ReadWriteTimeout.  That value is now used to set the Read/WriteTimeout on the underlying socket, with it then affecting all synchronous reads and writes on that connection.  The ReadWriteTimeout is added to the cache key for whether the cached HttpClient instance can be used, as is whether the request is sync or async because that influences how connections are created from the HttpClient instance.
@ghost
Copy link

ghost commented Jan 29, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Uses the recently added support for SocketsHttpHandler.ConnectCallback to be used for synchronous operations (#45300) to add support for HttpWebRequest.ReadWriteTimeout. That value is now used to set the Read/WriteTimeout on the underlying socket, with it then affecting all synchronous reads and writes on that connection. The ReadWriteTimeout is added to the cache key for whether the cached HttpClient instance can be used, as is whether the request is sync or async because that influences how connections are created from the HttpClient instance.

Fixes #43520

A couple of notes:

Author: stephentoub
Assignees: -
Labels:

area-System.Net

Milestone: -

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stephentoub stephentoub added this to the 6.0.0 milestone Jan 30, 2021
@stephentoub stephentoub merged commit c9d1fd6 into dotnet:master Feb 1, 2021
@stephentoub stephentoub deleted the hwrtimeout branch February 1, 2021 16:48
@ghost ghost locked as resolved and limited conversation to collaborators Mar 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpWebRequest timeout broken with proxy/ssl, repro attached
2 participants