powered by Jive Software

Max IQ Packet Size or Invalid Content

Hi,

I’m using IQ messages to ship some data around and am having trouble with connection failures in some cases, possibly due to large data transfers or certain content.

Both the sending and receiving apps are Java applications using Smack as the XMPP API. The general data transfer mechanism has been working great for several months until today when I tried to ship very large amounts of data (dozens or hundreds of KB) in a single IQ packet. Thinking that the data was simply too big, I then tried reducing the data to 1KB or less per packet, but still had trouble. Based on this it made me wonder if maybe it’s the content and not the packet size that is the issue, but the reality is that the data arrival rate is still very high on the receining end- just multiple IQ packets instead of one big one.

Note: the sending side is not having any problem, just the receiving side.

Below is a snippet from my XMPP dump logs showing the connection fail event during the data transfer.

Any thoughts on what the problem might be or where I should be looking?

Thanks,

Dan


… </mediaAddresses>

<age>-1</age>

<id>zzz://p.com/400000129/main/cnt/CONTACT_682</id>

</person>

]]></string></value>

</data>

</array>

</value>

</param>

</params>

</methodResponse>

</query>

</iq><iq id=“63Eh0-103” to="x@chat.x.net/communicator_test" type=“result” from="y@chat.x.net/xmppagent"><query xmlns=“jabber:iq:rpc”>

<methodResponse>

<methodName>abc.xyz</methodName>

<methodCallId>null</methodCallId>

<params>

<param>

<value>

<array>

<data>

<value><string><![CDATA[<person>

<firstName>Bob</firstName>

<lastName>Smith</lastName>

<birthday>-157136400000</birthday>

<creationDate>1163365853000</c

15:16:24.155 XmppDebugger$2::write: SENT> (17605128): <presence id=“63Eh0-147” type=“unavailable”></presence>
15:16:24.155 XmppDebugger$2::write: SENT> (17605128): </stream:stream>
15:16:24.525 XmppDebugger$4::connectionClosedOnError: Connection closed due to an exception (17605128)
15:16:25.326 XmppDebugger$4::reconnectingIn: Connection (17605128) will reconnect in 9

15:16:26.328 XmppDebugger$4::reconnectingIn: Connection (17605128) will reconnect in 8

Mystery solved- the Smack parser apparently didn’t like ‘&’ symbols in some of the tag bodies. (Oddly enough the strings were wrapped in CDATA fields.) Anyway, I escaped them out and it works fine now, even with the very large data fields.