/// <summary> /// Stops ScreenCapturer and publisher. and cleans everthing related. /// </summary> public static void StopSharing() { try { IsPublisherEnabled = false; ImageProcessing.StopScreenCapturer(); SenderThread.Abort(); Publisher.Stop(); TimeBasePublisher.Stop(); FPS = 0; TransferSpeed = 0; } catch { Debug.WriteLine("Failed to Stop Publisher"); } }
/// <summary> /// Stops Publisher and kills the related thread. /// </summary> public static void StopSendingCommands() { try { IsPublisherEnabled = false; if (Thread_Publisher != null) { if (Thread_Publisher.IsAlive) { Thread_Publisher.Abort(); } } if (Publisher != null) { Publisher.Stop(); Publisher = null; } } catch { Debug.WriteLine("Failed to Stop Publisher"); } }