Esempio n. 1
0
        static async Task HandleCommand(dynamic input, IRpcResponse <string> response)
        {
            record["status"] = "Handling command";
            Console.WriteLine(input.command);

            ProcessStartInfo psi = new ProcessStartInfo();

            psi.FileName        = "node";
            psi.Arguments       = input.commandParams;
            psi.UseShellExecute = true;


            Process proc = new Process
            {
                StartInfo = psi
            };

            proc.Start();

            response.Send("Process completed");
            record["status"] = "Completed";
        }
Esempio n. 2
0
        static async Task HandleCommand(string input, IRpcResponse <string> response)
        {
            if (string.IsNullOrEmpty(input))
            {
                response.Error("invalid input");
            }

            if (false)
            {
                response.Reject();
            }

            switch (input)
            {
            case "runProcess":
                await RunProcess();

                break;
            }

            response.Send(input);
        }