0

I am calling a webservice to send sms to clients from my ASP.NET web app. Sometimes this webservice takes too much time to return a response, and this is causing problems with the next functions called in my app. So is there any way to add time out for the response from my app? In other words: can I add a time out so whenever the response time exceeds time out, my app continue working instead of waiting for a response?

Mlle 116
  • 1,149
  • 4
  • 20
  • 53

1 Answers1

0

How do you make the request ... HttpWebRequest? If this is the case you have a timeout property - https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.timeout(v=vs.110).aspx

In case you don't care about the response, you can go with "Fire and forget" approach. You can find more information here - Simplest way to do a fire and forget method in C#?

Community
  • 1
  • 1
frontlinebg
  • 423
  • 5
  • 5