Refactor the TorWebClient

This commit is contained in:
2024-03-12 12:20:53 -04:00
parent 076ab7b887
commit bcc56a1e73
34 changed files with 351 additions and 139 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Tor
@@ -24,5 +25,34 @@ namespace Tor
else sb.Append(String.Format(formatString.ToString(), number));
return sb.ToString();
}
public static String ThreadStateToString(Thread thread)
{
switch(thread.ThreadState)
{
case ThreadState.Running :
return "Running";
case ThreadState.StopRequested :
return "StopRequested";
case ThreadState.SuspendRequested :
return "SuspendRequested";
case ThreadState.Background :
return "Background";
case ThreadState.Unstarted :
return "Unstarted";
case ThreadState.Stopped :
return "Stopped";
case ThreadState.WaitSleepJoin :
return "WaitSleepJoin";
case ThreadState.Suspended :
return "Suspended";
case ThreadState.AbortRequested :
return "AbortRequested";
case ThreadState.Aborted :
return "Aborted";
default :
return "Unknown";
}
}
}
}