Platform: Android
Used libraries:
compile ‘org.igniterealtime.smack:smack-android:4.2.0-alpha2-SNAPSHOT’
compile ‘org.igniterealtime.smack:smack-android-extensions:4.2.0-alpha2-SNAPSHOT’
compile ‘org.igniterealtime.smack:smack-tcp:4.2.0-alpha2-SNAPSHOT’
My code relevant to establishing a connection:
AndroidSmackInitializer initializer = new AndroidSmackInitializer();
List exc = initializer.initialize();
if ( exc != null )
for ( Exception ex : exc )
Debug.log(ex);
XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration.builder()
.setConnectTimeout(5000)
.setHost(ServerConfig.HOST)
.setPort(ServerConfig.PORT)
.setDebuggerEnabled(true)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setXmppDomain(JidCreate.domainBareFrom(“haber”))
.performSaslAnonymousAuthentication()
.setCompressionEnabled(false)
.setSendPresence(true)
.allowEmptyOrNullUsernames();
connection = new XMPPTCPConnection(config.build());
connection.connect()
username = “ǂAndro” + getRandomInt();
SASLAuthentication.registerSASLMechanism(new SASLAnonymous().instanceForAuthentication(connection));
connection.login();
;
The resulting connection object:
Then, I try to join a muc, like this:
MultiUserChat chat = MultiUserChatManager.getInstanceFor(connection)
.getMultiUserChat(JidCreate.entityBareFrom(ServerConfig.STARTUP_ROOM)); //startup_room = “haber@conference.etf.ba”
//chat is this http://prntscr.com/844e0v
chat.join(Resourcepart.from(username));
Now, on my web client, it says “ǂAndro645 has joined the room.”. And I can see the user on the online list, even message him (theh private chat works flawless)
But the chat.join() blocks for timeout (whici is 5000 ms) and then throws org.jivesoftware.smack.SmackException$NoResponseException
The full server-client conversation is in the attachment.
I hope this was detailed enough
sent-recv.txt.zip (2685 Bytes)