Esempio n. 1
0
        /// <summary>
        /// Either creates a server in this thread, or sends data to a running server.
        /// </summary>
        /// <param name="args">The command-line arguments.</param>
        public static void Main(string[] args)
        {
            //*
            Console.WriteLine ();

            // Help the user if they need it
            if (args.Length == 0 || args [0].Equals ("help")){
                if (args.Length > 1)
                    Console.WriteLine (Help (args [1]));
                else
                    Console.WriteLine (Help ());
                return;
            }

            if (!(args [0].Equals ("server") || args [0].Equals ("client"))) {
                Console.WriteLine ("Unrecognized command. Exiting kast. Use \"kast help\" for help.");
            } else {
                if(args[0].Equals("server")){
                    var server = new Kast.Server.Program ();
                    server.Start ();
                } else {
                    // Send everything but "client"
                    Client.Program.main (Misc.Subsequence (args, 1, args.Length).ToArray());
                }
            }
            //*/
        }
Esempio n. 2
0
        /// <summary>
        /// Until the project is mature, I will be using this to test the program
        /// </summary>
        public static void Test()
        {
            //*
            KastConfiguration master = new KastConfiguration ();
            master = new KastConfiguration(KastConfiguration.DefaultConfiguration ());

            Logger log = new Logger (master.Get("server_log"));

            Kast.Server.Program server = new Kast.Server.Program (master, log);
            Kast.Client.Program client = new Kast.Client.Program (master, log);

            // The server is running now
            new Thread (new ThreadStart (server.Start)).Start ();

            client.SendData ("box gshfdkgj sdgfjk");

            Console.WriteLine ("Successful test");
            //*/
        }
Esempio n. 3
0
        /// <summary>
        /// Until the project is mature, I will be using this to test the program
        /// </summary>
        public static void test()
        {
            Kast.Server.Program server = new Kast.Server.Program ();

            // The server is running now
            new Thread (new ThreadStart (server.Start)).Start ();

            Client.Program.SendData ("box echo +args hello,msg name hello+");
            Client.Program.SendData ("box notify-send +name writer+");
            Client.Program.SendData ("hook |box notify-send +args \"hi\"+| |hello| |name myName|");

            Console.WriteLine ("Successful test");
        }