I have a thread that is blocking on a Networkstream Read call. How do I best abort this thread? I tried calling Thread.Abort on the thread from another thread, which according to MSDN should raise a ThreadAbortException. However the ThreadAbortException is not raised at all in the thread. It is however, when I remove the blocking Read call and just have the thread sit in a loop. What is the best way to do this? Can I wait on the Read call and an event at the same time so the thread unblocks if either occurs? Then I could just signal that event from another thread.
Close the socket! The Read should then throw an exception.
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