public virtual void Sleep() { if (ListenerThread != null) { ListenerThread.Abort(); ListenerThread = null; } }
/// <summary> /// Stops the Proxy Server, removes the Windows proxy settings, and cleans up the thread. /// </summary> public void Stop() { // remove the proxy this.SetProxy(false); //stop listening for incoming connections Listener.Stop(); //wait for server to finish processing current connections... ListenerThread.Abort(); ListenerThread.Join(); }
private void SafeExit() { if (PulseThread != null) { if (PulseThread.IsAlive) { PulseThread.Abort(); } } if (ListenerThread != null) { if (ListenerThread.IsAlive) { ListenerThread.Abort(); } } Process.GetCurrentProcess().Kill(); Application.Exit(); }