/// <summary> /// Close the connection to the Folding@Home client server. /// </summary> public void Close() { // close the network stream _lockedStream.Release(); // close the connection _tcpClient.Close(); // send connected event OnConnectedChanged(new ConnectedChangedEventArgs(false)); // send status message OnStatusMessage(new StatusMessageEventArgs("Connection closed.")); }
/// <summary> /// Close the connection to the Folding@Home client server. /// </summary> public void Close() { bool connected = Connected; // close the network stream _lockedStream.Release(); // close the connection _tcpClient.Close(); if (connected != Connected) { // send connected event OnConnectedChanged(new ConnectedChangedEventArgs(false)); // maybe use Connected property? // send status message OnStatusMessage(new StatusMessageEventArgs("Connection closed.", TraceLevel.Info)); } }