Forum Discussion
Maybe this article could be of use: Checking Whether an Object Exists
- ash1010 years agoOccasional Contributor
I do not want to wiat based on time as time might vary based on PC
- Manfred_F10 years agoRegular Contributor
Of course it's safer, quicker and much more elegant to wait for status changes instead of waiting for "magic" time values.
But You can't avoid completely using time thresholds: what happens, if your application hangs up during shutdown? How will You detect it?
It won't give You a status "hung up". So, You choose a maximum time for closing, double it, and wait. If in the meantime, the application is gone, You exit successful. If the waiting time elapses, You exit without success.
It is always the same with asynchronous communication: You never know, whether the partner didn't respond or whether the reply was lost. Your only chance is to wait and then react.
Related Content
- 14 years ago
- 12 years ago
- 8 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago