-
Notifications
You must be signed in to change notification settings - Fork 260
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
Timeout value is not respected on Android #192
Comments
Fixed |
Timeout value is not respected on Android anaisbetts#192
I found with my own project that changing the OkHttpNetworkHandler to set the timeouts for the OkHttpClient to 0 (which signifies infinite), then checking the IOException for if the task was cancelled seems to be a cleaner approach. This lets the HttpClientHandler use the cancellation token, which gets cancelled on the C# HttpClient after the timeout finishes. Less hassle, no extra properties, works fairly well. |
I am having this issue right now. I have an endpoint that takes a while so i set a 30 seconds timeout but the call timeouts before the 30 seconds, any idea? |
@thefex is it possible for you to update the PR to the latest OKHttp (if it isn't already). @paulcbetts needs to give some love to this repo. it's been neglected! |
@robertbaker I don't use ModernHttpClient anymore. I use new Xamarin HTTP stack implementation. |
@thefex Is the Xamarin HTTP stack available in Android projects? |
@lhaussknecht Sure it is. As opposed to the iOS projects it is not available in GUI settings. I have asked Miguel de Icaza about that - he said GUI option will be available in future (in next releases) as Android team hit release deadline. You can set it manually in code: or using @(AndroidEnvironment) build action: |
I am having kinda the same issue, timeout settings above 49 milliseconds will be ignored and the HttpClient will use the default timeout. Though, no problems on iOS. |
Hi, I'm having the same issue. I'm trying to check for server availability and I set the timeout property on the HttpClient to 2 seconds but it takes over a minute to timeout. Is there a fix for this? |
I released a new version of the plugin that fix this issue. I am planning to do more. Search for modernhttpclient-updated. |
Request never timeouts on Android (when there is established connection and timeout is due to external server responding slow , socket-like timeout).
Reason:
OkHttpClient.SetConnectionTimeout, ReadTimeout, WriteTimeout is not used, default value of 0 means: NO TIMEOUT.
Working on fix.
The text was updated successfully, but these errors were encountered: