0
votes

I'm currently working on a chat client which I'm building with the XMPP framework. I've explored the demo app and I noticed that when I enter my username/password, it's taking a very long time (about 15 seconds) to receive the connect and authentificate callbacks.

Is there a specific reason why it's taking so long to login and authenticate? Is it somehow possible to speed it up? Whatsapp or iChat for example is also using xmpp and it's very fast.

I'm using ejabberd as XMPP server on a Mac running 10.8 and xCode 4.4.

Thanks in advance!

3
i am not sure about it, but maybe the process of checking the certificate takes so long. i have worked with XMPP framework a few weeks ago, in my case the certifacte check takes very long. Maybe there is a way to speed it up in ejabbered.brush51
Did you get a solution for this ?DAMM108

3 Answers

2
votes

Not sure about your case, but some clients had these kind of delays when they perform DNS lookup for the server' domain. The workflow is to first search for SRV records, as expected by the XMPP spec. If there is no SRV record for the domain, then fallback and try to connect to the domain directly, at the expected 5222 port. But that procedure of first trying with SRV and then fallback can consume a few seconds.
If this is your case, you could configure your client to connect to the server without doing SRV lookups, or correctly setup the SRV records for your domain.

2
votes

SRV lookup takes the time thats why you are facing the problem

Resolve this by Setting [xmppStream setHostName: @"******"];

More explanation below

  • This hostName property is optional.
  • If you do not set the hostName, then the framework will follow the xmpp specification using jid's domain.
  • That is, it first do an SRV lookup (as specified in the xmpp RFC).
  • If that fails, it will fall back to simply attempting to connect to the jid's domain.
0
votes

Following up on the email thread I agree with ppolv that DNS timeouts are likely related here. Do you have SRV entries configured for your domain? Are they correct? If you dump the traffic generated by Psi and Trillian do you see a difference in DNS requests between them?