示例#1
0
 /// <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."));
 }
示例#2
0
        /// <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));
            }
        }