Exemple #1
0
    /// <summary>
    ///     main entry point for command line application
    /// </summary>
    public static void Main(string[] args)
    {
        string path = null;
        bool requireAuthToken = false;

        if (args.Length > 0)
        {
            requireAuthToken = true;
            path = args[0];
        }

        //create a new instance of the command proxy
        CommandProxy.CommandProxy proxy;
        if (path == null)
        {
            //hard code port
            int port = 10000;

            Console.WriteLine("Launching Proxy : auth:" + requireAuthToken + " port:" + port);
            proxy = new CommandProxy.CommandProxy(requireAuthToken, port);
            proxy.Run();
        }
        else
        {
            try
            {
                proxy = new CommandProxy.CommandProxy(requireAuthToken);

                Console.WriteLine("launching app : " + path);

                //todo: should we verify path?
                proxy.LaunchAndRun(path);
            }
            catch(Exception e)
            {
                Console.WriteLine("Could not start proxy : " + e.Message);
                return;
            }
        }

        //start the run loop, passing in the port to use, and whether an auth
        //token should be used
        //proxy.Run();
    }
Exemple #2
0
    /// <summary>
    ///     main entry point for command line application
    /// </summary>
    public static void Main(string[] args)
    {
        string path             = null;
        bool   requireAuthToken = false;

        if (args.Length > 0)
        {
            requireAuthToken = true;
            path             = args[0];
        }

        //create a new instance of the command proxy
        CommandProxy.CommandProxy proxy;
        if (path == null)
        {
            //hard code port
            int port = 10000;

            Console.WriteLine("Launching Proxy : auth:" + requireAuthToken + " port:" + port);
            proxy = new CommandProxy.CommandProxy(requireAuthToken, port);
            proxy.Run();
        }
        else
        {
            try
            {
                proxy = new CommandProxy.CommandProxy(requireAuthToken);

                Console.WriteLine("launching app : " + path);

                //todo: should we verify path?
                proxy.LaunchAndRun(path);
            }
            catch (Exception e)
            {
                Console.WriteLine("Could not start proxy : " + e.Message);
                return;
            }
        }

        //start the run loop, passing in the port to use, and whether an auth
        //token should be used
        //proxy.Run();
    }