I have a “random” bug with my smack application. When the client got disconnected by the server, sometime it will try to connect twice (the second connection throws an IllegalStateException (Already logged in to server)).
When I run my application in a debugger, I see that there is two “Smack Reconnection Manager” threads running when this bug occurs. So I guess the problem is with this duplicated thread.
What can cause this to happen? I suspect I do something wrong with my code… Any idea?
EDIT: cannot reply my own message!?
I made a patch to ReconnectionManager.java class to avoid that more than one Smack Reconnection Manager thread run at the same time.
My patch also fix a bug in the delay between reconnection (it always wait 10 seconds because the attempts variable is not incremented). I also modified the function to wait a random time to avoid server to be rushed when there is a downtime.
You can do what you want with this patch.
Ce message a été modifié par: Ohmer
smack.diff.zip (732 Bytes)