public string PingWorker(string key)
        {
            //refactor into a better way to ping the client from server
            var clientRequired = ActiveSocketClients.GetClient(key);

            if (clientRequired == null)
            {
                return("Client is currently not connected");
            }

            clientRequired.PingRequest = new Models.PingRequestModel();
            clientRequired.SendMessageAsync("CLIENT_STATUS");
            clientRequired.PingRequest.RequestSent = DateTime.Now;

            //wait for the response
            do
            {
                if ((DateTime.Now > clientRequired.PingRequest.RequestSent.AddSeconds(10)))
                {
                    return("Timed out waiting for client response");
                }
                else
                {
                    Thread.Sleep(500);
                }
            } while ((!clientRequired.PingRequest.ReadyForUIReporting));


            return(clientRequired.PingRequest.ClientStatus + " @ " + DateTime.Now.ToString());
        }
        public string ExecuteTask(string key)
        {
            //get client
            var clientRequired = ActiveSocketClients.GetClient(key);

            //if client is not found then return
            if (clientRequired == null)
            {
                return("Client is currently not connected");
            }


            //get task folder
            var    appData    = AppDomain.CurrentDomain.GetData("AppData") as string;
            string taskFolder = System.IO.Path.Combine(appData, "Tasks");

            var files = System.IO.Directory.GetFiles(taskFolder);

            foreach (var fil in files)
            {
                var taskData = System.IO.File.ReadAllText(fil);
                clientRequired.SendMessageAsync(taskData);
                break;
            }

            return(taskFolder);
        }