<p dir="ltr">Yes it is possible as it's an xml stream not a packet based protocol.</p>
<p dir="ltr">A socket read simply means you have data available to be read.</p>
<p dir="ltr">So in this instance the server had two stanzas available and they got sent together.</p>
<p dir="ltr">The opposite is possible. You could have a stanza that's too large so it takes multiple reads to receive the stanza.<br>
</p>
<div class="gmail_quote">On 20 Aug 2013 20:41, "Bradley Stone" <<a href="mailto:bvstone@bvstools.com">bvstone@bvstools.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi, all.<br>
<div><br></div><div>Quick question here. I just ran into a situation where on a single read from a socket my jabber application received two stanzas. One was an IQ (ping) and the second was a presence.</div><div><br></div>
<div>Example:</div><div><br></div><div><iq from='<a href="http://jabber.org" target="_blank">jabber.org</a>' to='user1' type='get' id='ping'><ping xmlns='urn:xmpp:ping'/></iq><presence from='user2' to='user1' type='unavailable'/><br>
</div><div><br></div><div>I hadn't programmed for this and now am making the appropriate changes, but I have a couple questions since it appears to be normal (but rare) to include multiple stanzas on one socket write on the server side.</div>
<div><br></div><div>1. Can multiple IQ stanzas be sent at once?</div><div>2. Can multiple presence or message stanzas be sent at once?</div><div><br></div><div>Thanks.. let me know if this isn't clear. :)</div><div>
<br></div><div>Brad</div></div>
<br>_______________________________________________<br>
JDev mailing list<br>
Info: <a href="http://mail.jabber.org/mailman/listinfo/jdev" target="_blank">http://mail.jabber.org/mailman/listinfo/jdev</a><br>
Unsubscribe: <a href="mailto:JDev-unsubscribe@jabber.org">JDev-unsubscribe@jabber.org</a><br>
_______________________________________________<br>
<br></blockquote></div>