I’m currently working on my client code to login to the XMPP server (Openfire). On my first attempt I used XMPPConnection.login with user name and password. To disconnect to the server, I just simply use XMPPConnection.disconnect. However, I’m getting a stream:error from this approach. I’ve read somewhere that it’s because the client is attempting to login again with the same resource.
What I did next was to use XMPPConnection.login with user name, password, and a randomly generated alphanumeric string as a resource. This random resource is created everytime a user logs in. This got rid of the stream:error problem but it generated another. When I logout (XMPPConnection.disconnect) and log in again after a brief time, I noticed that the user is logged in using 2 resources. When the user logs out again, it’s only logged out for one of the resources but still logged in for another.
Any idea what the problem could be here?