Exemplo n.º 1
0
        public bool Run()
        {
            // packet keys
            PacketKey   k   = new PacketKey();
            JSONBuilder kjb = new JSONBuilder();

            kjb.closeMe();
            k.addToJSON(kjb);

            Console.WriteLine(kjb.ToString());
            Console.WriteLine("====");

            // packets
            Packet p  = new Packet(new ComData("test"));
            string sp = p.Pack();

            Console.WriteLine(sp);

            Packet p2;

            Packet.Unpack(sp, out p2);

            Console.WriteLine(p2);

            return(true);
        }
Exemplo n.º 2
0
        public string Pack()
        {
            JSONBuilder jb = new JSONBuilder();

            Key.addToJSON(jb);
            jb.addObject("Data", Data);
            jb.closeMe();
            return(jb.ToString());
        }