Esempio n. 1
0
        private static void DiscoverClient()
        {
            // change the Jid when running the example to a online user, otherwise this will not work
            Jid jid = new Jid("admin@vm-2k/ALEX-LAPTOP");

            IQ iq = new IQ(agsXMPP.protocol.client.IqType.get);
            iq.To = jid;
            iq.From = new Jid(JID);
            iq.GenerateId();

            iq.AddChild(new agsXMPP.protocol.iq.disco.DiscoInfo());

            /*
             * we pass an additional object (jid) here with the IqGrabber
             * Passing the jid makes no sense because you can also read it from the iq response, but
             * this is only an example to show that you can pass any object you need in your business logic
             */
            comp.IqGrabber.SendIq(iq, new IqCB(OnDiscoResult), jid);
        }
Esempio n. 2
0
        private static void RequestServerVersion()
        {
            IQ iq = new IQ(agsXMPP.protocol.client.IqType.get);
            // change the Jid when running the example to a online user, otherwise this will not work
            iq.To = new Jid("admin@vm-2k/ALEX-LAPTOP");
            iq.From = new Jid(JID);
            iq.GenerateId();

            iq.AddChild(new agsXMPP.protocol.iq.version.Version());
            //iq.AddChild(new agsXMPP.protocol.iq.disco.DiscoInfo());
            comp.IqGrabber.SendIq(iq, new IqCB(OnVersionResult));
        }