I am having some issues getting a Smack connection to my Wildfire server. The server is version 3.1.1, and is functioning normally otherwise. When I attempt to initiate a connection from my code, using Smack, I sometimes get a connection, but usually I get the following:
The first 2 lines are my own outputs, indicating first that new XMPPConnection() has succeeded, and isConnected() is true, then that the login() function failed. Somehow, between the 2 lines of code, it appears that I lost my connection to the server…I do not understand this.
Here is the relevant code:
(Log and code put into links because the new-ish forum software kept mangling my code…)
Any help with this would be greatly appreciated.
it seems that you are still using the current (“old”) Smack code. I’‘m not sure if one want’'s to fix this problem there. But your code is really evil, instead of a sleep() you create a while() loop which uses 100% cpu until the connection state changes to connected.
I think that this is a known bug within this version, one should find some posts about this problem in the forum.
Yeah, that was just a quick and dirty hack to see if it was just trying to log in too quickly…I just got sidetracked by more important issues before I got chance to fix it.
I’‘ll poke around in the forum to see what I can find, but you say this is the “old” code? Is there new code I should download yet, even if it’'s only beta?
http://www.jivesoftware.org/community/thread.jspa?messageID=129280 is the thread regarding the new version which is as far as I know used within Spark and supports smooth reconnection.
http://www.jivesoftware.org/issues/browse/SMACK contains the list of fixes, one can download nighly builds of it.
As I do not really use Smack I’'m not sure if one can recommend to use the beta version. But if you encounter bugs in the current version you can be very sure that they will not be fixed in it.