powered by Jive Software

Taking long time to connect ejabberd server through smack client library

Hello all, it is taking long time nearly about 15 seconds and more while logging to ejabberd server from android app, using smack v 4.3.1. Can anyone guide me how to reduce the time during authentication process? Also, I found that during login smack library is requesting server to send entity caps and only after it is sent by the server it is trigerring “authenticated” callback of connnection listner.

` SmackConfiguration.DEBUG = true
XMPPTCPConnection.setUseStreamManagementResumptionDefault(false)
XMPPTCPConnection.setUseStreamManagementDefault(true)
AndroidUsingLinkProperties.setup(context)

val builder = XMPPTCPConnectionConfiguration.builder().apply {
    //setCompressionEnabled(true)
    setXmppDomain(JidCreate.domainBareFrom("HOST_NAME"))
    setPort(5222)
    setSecurityMode(ConnectionConfiguration.SecurityMode.required)
    //configSSL()
}`

Yes, this is (currently) by design and can (currently) only be avoided if you do not load the causing managers.

1 Like

The connection time was reduced to 1-2 seconds from 15 seconds. I just disabled the causing managers from SmackConfiguration class.
Very thankful for the help.