SmackConfiguration.setPacketReplyTimeout

Hello.

I have been writing quite a few methods to perform simple operations like create/update/delete account on Jabber, etc and I keep intermittently getting one of these errors always:

Authentication failed.:

at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication .java:91)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:345)

No response from server.:

at org.jivesoftware.smack.AccountManager.createAccount(AccountManager.java:237)

at org.jivesoftware.smack.AccountManager.createAccount(AccountManager.java:203)

By default the packet reply timeout is set to 5sec by Smack. However, when I set it to 10 sec, using SmackConfiguration.setPacketReplyTimeout(10000); I do not get these errors. Needless to mention the code becomes very slow when I reset the timeout value.

Can someone please tell me how to get around this problem? The Jabber server, network, etc are very fast, there is no reason why a request should take so long. I am not even loading the server with many requests, just executing one for now.

Thanks in advance for any help.

  • Neha.

Are there any pointers on this?

Anyone noticed similar behavior?

Thanks,

Neha.

Are yousure it’s not because of the authentication error? Try turning TLS on and off in your ConnectionConfiguration.

My server has only NONSASL authentication enabled, so I’ve set SASLAuthenticationEnabled to false.

I tried using Ethereal to check the response from the server and it shows me that the server is returning correct result. Also, when I set the reply timeout to 10 sec, it works correctly. So, I’m pretty sure that it is not an authentication issue, its just that the PacketCollector is not waiting for enough amount of time for the server to return the correct result and I’m pretty sure that it is not waiting the whole 5 sec before returning null.

Thanks,

Neha.