Webservice : AsyncCall finished : But WaitOne() still waiting
-
11-02-2021 - |
سؤال
- I am calling a WebService method via a Command Line Exe.
- This method call is Async Call and I am using WaitOne after the Call.
- I am doing ManualRest.Set() in completed method.
The above setup works fine 99% of the cases where the async method returns withing 10-20 mintues,
Problem occurs when the Async Call takes more time like 2-3 hours then the code after WaitOne() is not being executed.
I am writing logs before and after waitone() and in Completed event also but the control does not seems back after a 3 hours of async call.
Any help / pointer on above ...
Thanks.
المحلول
Are you sure that Set is being called? Are you using System.Diagnostics.Process
? Please post the code for how you use the process in your question.
When using a process there is an extremely high risk of creating a deadlock, especially if you use the code examples on MSDN that show you how to read from StandardIn and StandardOut synchronously.
Try using the asynchronous read methods instead to avoid deadlock.