GSF.ServiceProcess.ServiceHelper.DisconnectClient C# (CSharp) Method

DisconnectClient() public method

Disconnects the client from the service.
public DisconnectClient ( System.Guid clientID ) : void
clientID System.Guid The ID of the client.
return void
        public void DisconnectClient(Guid clientID)
        {
            ClientInfo disconnectedClient;

            m_statusUpdateThread.Push(() => m_clientStatusUpdateLookup.Remove(clientID));
            disconnectedClient = FindConnectedClient(clientID);

            if ((object)disconnectedClient == null)
                return;

            if (clientID == m_remoteCommandClientID)
            {
                try
                {
                    RemoteTelnetSession(new ClientRequestInfo(disconnectedClient, ClientRequest.Parse("Telnet -disconnect")));
                }
                catch (Exception ex)
                {
                    // We'll encounter an exception because we'll try to update the status of the client that had the
                    // remote command session open and this will fail since the client is disconnected.
                    LogException(ex);
                }
            }

            lock (m_remoteClients)
            {
                m_remoteClients.Remove(disconnectedClient);
            }

            UpdateStatus(UpdateType.Information, "Remote client disconnected - {0} from {1}.\r\n\r\n", disconnectedClient.ClientUser.Identity.Name, disconnectedClient.MachineName);
        }
ServiceHelper