[ejabberd] ejabberd sending two different stream starts
jack at chesspark.com
Thu Sep 4 18:35:33 MSD 2008
>> in a jabber client library I am currently writing I am having weird
>> on how ejabberd seems to send it's frist and second XMLs. Namely:
>> seem to be sometimes sent together, sometimes seperately. is there any
>> explanation for that?
>> will i have to build my library so it accepts both?
> The explanation may be that it takes some processing time to grab the
> features and send them, but it does not matter if they come with
> stream:stream or not, as long as they follow it. You will have to build your
> library to do both.
Christopher is correct. The way this is handled in libstrophe and
Strophe.js is that we create a handler for the stream:features stanza
and then we wait for them. We also have a timeout going in case they
don't come at all. This means we'll get them no matter which way they
are sent and no matter how long it takes to send them. I suggest
doing something generalized like this instead of hacking the code to
expect it in the first or second recv() call.
More information about the ejabberd