/// <summary> /// Shutdown all processes. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Closing(object sender, CancelEventArgs e) { // Close HRM device connection childThread.Abort(); // Stop listening AsynchronousSocketListener.Shutdown(); // Clean up ANT ANTInterface.Shutdown(); }