Commit 16c4494
[Mono.Android] Increase AndroidClientHandler timeouts (#3328)
Context: http://work.devdiv.io/911705
Context: dotnet/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.1 parent f951e60 commit 16c4494
1 file changed
+5
-4
lines changedLines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | | - | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
195 | | - | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
0 commit comments