Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono.Android] Increase AndroidClientHandler timeouts (#3328)
Context: http://work.devdiv.io/911705 Context: xamarin/xamarin-macios@30d60bf `AndroidClientHandler` has no way of accessing the `HttpClient.Timeout` property in order to set the timeout value of *two* native http client properties (connect and read timeouts), so it uses two custom properties to provide these values. So far, the values were set to 100 seconds for the read timeout and 120 seconds for the connect timeout, which seemed to be a reasonable value for their purposes. However, if a developer sets `HttpClient.Timeout` to a value *larger* than our defaults, `AndroidClientHandler` values "win" and the connection/read times out earlier. The workaround is to set "our" timeouts along with the `HttpClient` one, but if the developer cannot do it, for any kind of reasons (i.e. to avoid platform-specific code), then they are faced with an annoying situation. The real fix would be to improve `HttpClient` API so that its associated client handler can access `HttpClient` properties, but as that's not a quick fix we can implement now, we instead bump the default timeout values to the (unreasonable) value of 24 hours to make sure we use values higher than the most likely figures assigned to `HttpClient.Timeout`, and to match the Xamarin.iOS `NSUrlSessionHandler` defaults.
- Loading branch information