I am developing a Windows Forms application to perform several operations on a device connected via USB. For all operations, such as reading, writing and other things, we have a user library.
The recording operation is performed when the user presses the button.
A separate stream is created for reading. The problem with the available library is that the Read call is blocked and has an INFINITE timeout.
In the event of a connection failure, this thread starts when the Read function is called, since this function breaks only if it receives data.
What could be the way to kill this thread in such a scenario? Thread.Abort () does not work.
I am using C # for this programming.
source
share