I have created a web application that uses Task.Wait. Soon after I used it my application slowly came to a crawl about 30 days later. I never found out why but I am suspecting it is the Task.Wait method that never time out if the remote server never response. Just wanted to know if Task.Wait is executed will it wait forever it remote server never response?
Looking at the source from Reference Source, this if the code from Task.Wait() :
public void Wait()
{
#if DEBUG
bool waitResult =
#endif
Wait(Timeout.Infinite, default(CancellationToken));
#if DEBUG
Contract.Assert(waitResult, "expected wait to succeed");
#endif
}
So, the timeout is Timeout.Infinite!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With