Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //
            // TODO: Add code to start application here
            //
            if (args.Length != 2)
            {
                Console.WriteLine("Wrong number of arguments. Got {0} instead.", args.Length);
                return;
            }

            MyHandler myH = new MyHandler();
            Parameters p = new Parameters();
            p.ServerUrl = args[0];

            Connector c = new Connector();
            if (c.Open(p))
            {
                Message m = new Message();
                m.Set("do_method", "notify");
                m.Set("kn_to", args[1]);
                m.Set("kn_payload", "Hello");
                m.Set("nickname", "dotnet");
                m.Set("kn_response_format", "simple");

                c.Publish(m, myH);

                c.Close();
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //
            // TODO: Add code to start application here
            //
            if (args.Length != 2)
            {
                Console.WriteLine("Wrong number of arguments. Got {0} instead.", args.Length);
                return;
            }

            MyHandler  myH = new MyHandler();
            Parameters p   = new Parameters();

            p.ServerUrl = args[0];

            Connector c = new Connector();

            if (c.Open(p))
            {
                Message m = new Message();
                m.Set("do_method", "notify");
                m.Set("kn_to", args[1]);
                m.Set("kn_payload", "Hello");
                m.Set("nickname", "dotnet");
                m.Set("kn_response_format", "simple");

                c.Publish(m, myH);

                c.Close();
            }
        }