Is it possible that I call Thread.Sleep(1000)and the application can go to sleep for a very long amount of time, for example, in a minute or more?
It looks like this is happening in my application. I use Thread.Sleep, and the application seems to be hanging in the middle.
When I press Ctrl + Alt + Break, it points to a line immediately before calling Thread.Sleep. If I try to look at a variable, it says that the thread is in sleep mode and the variable is not in scope.
EDIT:
public void Write(string command)
{
_port.WriteLine("\r");
_port.WriteLine(command + "\r");
Thread.Sleep(100);
}
Manoj source
share