Sean Gilbertson wrote:
Hi all,Thank you for your responses and suggestions. I have some more information on this issue: I took out all the code that retrieves the contact list and sets the status (which would trigger availability information), and the server still closes the connection gracefully (i.e. by sending </stream:stream>). I even took out the library I was using to handle parsing the XML; I just read it in (in a buffered fashion), and spit it out. So, it seems as though - on my phone at least (not in debug mode on my computer!) - as soon as I finish sending stanzas one after another, the server closes the connection. What's up with that? Oh, and the server is Google Talk. I'm using SSL.
Maybe download one of the open-source servers and test things out locally before you try to run your software against a live service such as Google Talk? Also, Google Talk has some quirks. You might want to test things with, say, the jabber.org service first.
Here's what the server sends to me: <stream:stream from="gmail.com" id="2823903EEAA22D0D" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"> <iq type="result"> <query xmlns="jabber:iq:auth"> <username/> <resource/> <password/> </query> </iq> <iq type="result"/> </stream:stream>
What did you send before you received that?
It seems to me that perhaps you sent this:
<stream:stream
to="gmail.com"
xmlns:stream="http://etherx.jabber.org/streams"
xmlns="jabber:client">
<iq type="get">
<query xmlns="jabber:iq:auth"/>
</iq>
The server may not be happy that you tried to send the <iq/> before you
received the response stream header.
Peter -- Peter Saint-Andre https://stpeter.im/
smime.p7s
Description: S/MIME Cryptographic Signature
