Hello,
public void threadMethod()
{
try
{
// do something
}
catch (ThreadInterruptedException e)
{
Console.WriteLine("[Net]", role, "Thread interrupted.");
n.CloseConnection();
}
finally
{
if (isAutenticated == false)
{
n.CloseConnection();
}
Dispatcher.Invoke(addMessage, "Network connection searching was disabled.");
DebuggerIX.WriteLine("[Net]", role, "Finished");
Dispatcher.Invoke(threadStoppedDel);
}
}
The method threadMethod is run via System.Threading.Thread. The thread may be interrupted whenever therefore the exception ThreadInterruptedException may be thrown in finally block, right? Do I have to enclose the block in finally in try-catch again?
Thanks!