c# - Retry the request if the first one failed -
I am using an XML web service on my web app and sometimes the remote server failed to respond to the timeline. If the first attempt fails, I have the idea of requesting again. To stop the loop, I want to limit the concurrent request at 2. I want to get an opinion, if I have done it then it is fine and will work as I think.
public class ScEngine {Private int _attemptcount = 0; Public int attempts ({get return _attemptcount}} set {_attemptcount = value;}} Getstat public string (string q, string job) {try {// snip .... trycount + trycount; return ds;} {If (trycount> = 2) {return tap;} and {return GetStat (Q, job);}}}}}
Comments
Post a Comment