AnsweredAssumed Answered

Error while connecting ejabberd using smack 4.2

Question asked by Ankur on Apr 14, 2017

up vote0down votefavorite

 

 

using smack 4.2 to connect to ejabberd using following code:

val config = XMPPTCPConnectionConfiguration.builder() 
             .setUsernameAndPassword(mUsername, mPassword)
           
.setHost("xxxxx.yy.net:5280/http-bind")
             .setXmppDomain(xxxxx.yy.net)
             .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
             .setDebuggerEnabled(true)

mConnection= XMPPTCPConnection(config.build())
mConnection!!.addConnectionListener(this)
mConnection!!.connect()
mConnection!!.login()

End up getting the error:

W/System.err: org.jivesoftware.smack.SmackException$ConnectionException: The following addresses failed: 'xxxxx.yy.net:5280/http-bind:5222' failed because: de.measite.minidns.util.MultipleIoException: socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied), socket failed: EACCES (Permission denied)

I am getting the error because of wrong address it should be xxxxx.yy.net:5280/http-bind . I don't know how it is adding 5222 port no also in address.

username is in the user@domain_name format.

Outcomes