public static void StopForwarding()
{
if (ListenForDataThread != null)
{
if (RecordingEnabled == false)
{
RequestStop = true;
Thread.Sleep(200);
if (ListenForDataThread.IsAlive == true)
{
Cleanup();
ListenForDataThread.Abort();
}
}
ForwardingEnabled = false;
if (tx_sock != null)
tx_sock.Close();
}
}