0

In the current xamarin app we are using RESTful services. Sometimes it takes couple of seconds, sometimes it takes 30-45 seconds and sometimes they keep running without returning anything. Until the value is returned user can't move ahead.

I am planning to can keep a timer and wait for few seconds, if we do not get any response within few seconds we can make the service call again or ask user to try again.

I was wondering if there is a better approach to resolve such issue.

TheDeveloper
  • 1,127
  • 1
  • 18
  • 55

1 Answers1

1

All WebRequests have a timeout duration. If you're using HttpClient, RestSharp or HttpWebRequest, set the timeout duration and then recall your method until it returns a value.

Take a look at: How can I tell when HttpClient has timed out?

Community
  • 1
  • 1
Dispersia
  • 1,436
  • 9
  • 23