Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
tosse #1
Member since Nov 2009 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Ad-Hoc Commands
Hi,

I'm trying to remote control a client. Therefor I wrote to clients one that sends the command (sender) and one that receives the command (receiver).
So far the sender sends an IQ with the command to the receiver. I catch the incoming IQ in a IQ Listener (is this correct?), and than I would like to fetch the command out of the IQ. I tried it that way
        static void xmppCon_IqHandler(object sender, IQ iq)
        {
            Console.WriteLine(iq);
            agsXMPP.Xml.Dom.NodeList nodelist = iq.ChildNodes;

            foreach(agsXMPP.Xml.Dom.Node node in nodelist){
                Console.WriteLine(node);
            }
        }

Can anybody help me how to get the a Command-Object out of the node-Object.

Thanks for your help
Avatar
Alex #2
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by tosse:
Can anybody help me how to get the a Command-Object out of the node-Object.

  1. Command cmd = iq.SelectSingleElement<Command>();
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS