Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page: previous  1  2 
Avatar
Alex #16
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 3467
I attached a working component example which sends a disco request to the server in the OnLogin event.
It is important that your callback signature matches the following:

  1. void OnDiscoServerResult(object sender, agsXMPP.protocol.client.IQ iq, object data)
  2. {
  3.    //add your code here
  4. }

agsXMPP.protocol.client.IQ is the base class for all IQ's in the different namespaces.
Let me know when you have any questions.

Regards,
Alex
The author has attached one file to this post:
Component.zip 256.9 kBytes
You have no permission to open this file.
Avatar
bmurphy #17
User title: Manager
Member since Jul 2008 · 11 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
Subject: Working now
Hi Alex,

Thanks for the example, it works for me but did not solve the Room Discovery problem for me straight away but I have now figured it out with your help and examples.

I had been assuming I needed to change the iq of the event handler to be in the component namespace i.e. agsXMPP.protocol.component.IQ which I understand now to be WRONG and causes the no overload error.

However the real reason my Room Discovery wasn't working from your origonal code snippet is I needed to set a from address in the request
discoIq.From = new Jid(JID);
in addition to the to address
"discoIq.To = new Jid("conference.localhsot");"


Thanks for you help thus far ! I appreciate it.

Bernie
Avatar
Alex #18
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi Bernie,

normally you don't need the from address because the server has to stamp it and you are not able to spoof it in xmpp.
I added it in my example because Openfire ignores packets without the from address, and I used the Openfire server for testing this example.

Alex
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:
Page: previous  1  2 
Forum: agsXMPP RSS