Subject: Synchronous IQ with IqGrabber
Hi,
I have a question regarding the IqGrabber, as I am not sure, if I got something wrong there.
As I am in need of synchronous IQs I took a look into documentation and found the IqGrabber, offering a sendIq-Method without taking a CB-function and returning an IQ. Description says: "Sends an Iq synchronous and return the response or null on timeout". What I get till now is always null. So is this generally possible or do I misunderstand anything?
My Code looks like this:
And the generated IQ-XML sent to the server:
BTW: Wenn using sendIq() with a specified callback function, I get a valid return.
Greetings,
Ted
I have a question regarding the IqGrabber, as I am not sure, if I got something wrong there.
As I am in need of synchronous IQs I took a look into documentation and found the IqGrabber, offering a sendIq-Method without taking a CB-function and returning an IQ. Description says: "Sends an Iq synchronous and return the response or null on timeout". What I get till now is always null. So is this generally possible or do I misunderstand anything?
My Code looks like this:
DiscoItemsIq discoIq = new DiscoItemsIq(IqType.get);
discoIq.To = new Jid("pubsub.example.com");
discoIq.From = new Jid(JID_SENDER);
IQ itemList = con.IqGrabber.SendIq(discoIq, 5000);
Console.WriteLine(itemList.ToString());
discoIq.To = new Jid("pubsub.example.com");
discoIq.From = new Jid(JID_SENDER);
IQ itemList = con.IqGrabber.SendIq(discoIq, 5000);
Console.WriteLine(itemList.ToString());
And the generated IQ-XML sent to the server:
<iq id="agsXMPP_4" type="get" to="pubsub.example.com" from="ted@example.com">
<query xmlns="http://jabber.org/protocol/disco#items" />
</iq>
<query xmlns="http://jabber.org/protocol/disco#items" />
</iq>
BTW: Wenn using sendIq() with a specified callback function, I get a valid return.
Greetings,
Ted