Ending an Asynchronous call
-
How can i stop an Asynchronous call which is initiated with
beginInvoke
before it is completed? CallingendInvoke
in the main thread does not work as it blocks the execution until the thread, which we started withbeginInvoke
, completes. Zafer -
How can i stop an Asynchronous call which is initiated with
beginInvoke
before it is completed? CallingendInvoke
in the main thread does not work as it blocks the execution until the thread, which we started withbeginInvoke
, completes. ZaferThere is nothing built into to .Net to do this for you. You would need use a ManualResetEvent[^] that is accessible from both your invoked method and the method you would like to stop the former. Basically, you need to code your invoked method so it is stoppable.
Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com