powered by Jive Software

Multiple connections for a client?


I’'m developing a system that uses Smack and that should be able to keep several of XMPPConnections (one for each user in our system) to a Jabber server, is this possible?

I have done some testing and it seems that the problem lies in the Smack API. When I connect two users (two connections) to one server I get:

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

at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 220)

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

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

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

at jabberclient.JabberClient.login(JabberClient.java:101)

I ahve also tried to setup two connections (one for each user) to two different jabber servers and the result is the same. My conclusions of these tests is that it has to depend on the Smack API.

Is there any workaround for this problem or what should I do to get this particular functionality?


what is the exception itself ? a 501 (feature not implemented) ? and … does it work the first time you connect to a server ?

i myself … have a client in smack which can connect to more than 1 account… i have no particular problem with more than 1 connection . .but sometimes because of random reasons … it somehow don’'t use SASL authentication … and NonSASL fails afterwards …

but after retrying a few times it sometimes starts working again …

i haven’'t figured out yet if it is a problem with me (client or my server) or some timeout … or whatever… or smack …

could you try reconnecting a few times … maybe it works after a few retries ? (~10 ?)

anyhow … i don’'t think the problem is because you use more than one XMPPConnection … never noticed any problems with that …


Herbert Poul