I am developing a Windows Forms Application to perform few operations on a device connected via USB. For All operations like Read, Write and other things, we have a custom library.
Write operation is done when User hits a button.
To read, a Separate thread is created. Problem with available library is that the Read call is blocking and has INFINITE Timeout.
In case of connection failure, this thread stucks at Read function call as this function breaks only if it recieves data.
What could be the way to Kill this thread in such scenario? Thread.Abort() is not working.
I am using C# for this programming.