Correct XMPP message to use for broadcasting a query
Question
I am trying to use Google's libjingle framework and need to broadcast a query from a client to other signed-in clients.
Is the correct way to do this with the IQ protocol (http://xmpp.org/extensions/xep-0099.html), the presence protocol (http://xmpp.org/rfcs/rfc3921.html) or just by looping through the relevant clients and sending a direct message?
Solution
Firstly XEP-0099 is deferred since 2003 (as per the red text at the top), I know no implementations of it, I really don't think it's what you are looking for.
Secondly, for <iq/>
stanzas in general, you cannot broadcast them. They are a one-to-one request-and-response mechanism. One request returns exactly one response (or error), and broadcasting would break that rule. To broadcast some information use a <message/>
or perhaps even <presence/>
. If you need to request information from a series of JIDs, <iq type="get">
probably is indeed the way to do it.