예제 #1
0
        public static void Main(string[] args)
        {
            //XmlDecoder decoder = new XmlDecoder();
            //string path = "../../XMLFile1.xml";
            //System.IO.FileStream xml = new System.IO.FileStream(path, System.IO.FileMode.Open);
            //SWTools.BlockingQueue<TestData> p = new SWTools.BlockingQueue<TestData>();
            //decoder.parse(xml, p);
            //while (p.size() != 0)
            //{
            //    TestData td = p.deQ();
            //    td.show();
            //}
            CommandData cmd = new CommandData();

            cmd.from       = "localhost";
            cmd.to         = "localhost";
            cmd.testAuthor = "me";
            cmd.testName   = "test";
            cmd.command    = "testcmd";
            cmd.dateTime   = "now";
            cmd.url        = "localhost";
            cmd.dllFiles.Add("1");
            cmd.dllFiles.Add("2");
            cmd.xmlFile = "testxml";
            CommandEncoder cmde = new CommandEncoder(cmd);

            Console.WriteLine(cmde.encode());
            CommandDecoder cmdd = new CommandDecoder(cmde.encode());

            cmd = cmdd.parse();
            CommandEncoder cmde2 = new CommandEncoder(cmd);

            Console.WriteLine(cmde2.encode());
        }
예제 #2
0
        CommandData parsingMessage(string msg)
        {
            CommandData    cmdData    = new CommandData();
            CommandDecoder cmdDecoder = new CommandDecoder(msg);

            cmdData = cmdDecoder.parse();
            return(cmdData);
        }