[JDEV] A query regarding <iq/> element

David Waite mass at akuma.org
Thu Apr 11 08:57:01 CDT 2002


Ritu Khetan wrote:

>Hello all, 
>
>I am studying the Programming Jabber book wherein I was
>studying about the \"to\" attribute in the <iq/> element.
>I found  some explanation there which I do not
>understand, I am thoroughly confused...
>
<snip>

>
>RECV: <iq type=\'result\' to=\'dj at yak/sjabber\' from=\'dj at yak\'>
><user name=\'DJ Adams\' xmlns=\'jabber:iq:browse\'
>jid=\'dj at yak\'/>
></iq>
>
<snip>

I don't know what the question is. A request was made for browse 
information; the 'to' address defaults to the initiating user's account, 
where a 'from' defaults (and as far as I know, is always overridden to) 
the initiating user's session. Generally, traffic to a session is routed 
directly, while traffic to the user account (sans resource) is handled 
by logic within JSM before getting futher routed. I'm unsure if this is 
always the case nowdays.

The 'user' element within the 'iq' is the response - it is the root 
entry in the browse information for the local user (actually, I would 
think that more information would be present, but thats neither here nor 
there)

>
>
>
>Can someone explain why does the iq result come in the
>form of <user name...DJ Adams ...jid=\'dj at yak\'/>
>
>Further, what is this funda about the client nothing
>getting a chance to respond..I do not understand this...
>
Its JSM (the IM session manager) within the server handling requests for 
clients.  The browse request sent to the user's account (not to an 
active session) gets handled by the JSM as a proxy. Another way JSM acts 
as a proxy is to route 'message's bound to the account (without a 
resource) to the "active" session (the most recent highest priority session)

-David Waite




More information about the JDev mailing list