Hi,
I have an issue regarding requesting data from a web service, when I execute a http request that takes longer than 60 seconds I get the following request timed out error:
(Replaced web service url with {URL})
System.Net.WebException: The request timed out. ---> Foundation.NSErrorException: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x28088d560 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<9>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<9>"
), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey={URL}, NSErrorFailingURLKey={URL}, _kCFStreamErrorDomainKey=4}
--- End of inner exception stack trace ---
at System.Net.Http.NSUrlSessionHandler+d__29.MoveNext () [0x001c3] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:202
--- End of stack trace from previous location where exception was thrown ---
at System.Net.Http.HttpClient+d__48.MoveNext () [0x00080] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
I tried setting timeout to InfiniteTimeSpan but this seems to be ignored..
Also I tried setting the NSUrlSessionConfiguration to:
NSUrlSessionConfiguration.DefaultSessionConfiguration.TimeoutIntervalForRequest = 90.0;
NSUrlSessionConfiguration.DefaultSessionConfiguration.TimeoutIntervalForResource = 90.0;
But this also seems to be ignored.
I am using only once instance of the HttpClient across the application.
All requests that are taking less that 60 seconds are working great.
I am hoping to find a solution.
Best regards,
Bas