Smack Reconnect Issue

I am using smack v4.2.2,
I tried to achieve an auto reconnecting cycle. The first reconnect attempt were successfully done, but connection listener won’t fire for second third and other attempt. I’ve tried to force the connection to reconnect on ping failed to the server but it return error :

org.jivesoftware.smack.SmackException$AlreadyConnectedException: Client is already connected

which mean the connection listener think that the client is still connected but in fact the user already disconnected. The method I used to disconnect the client is by turn on airplane mode. I also had tried to use auto reconnect by reconnectionManager but it produce the same result. What should I do?

update :
as for now, I run disconnect() on pingFailed, and reconnect the connection.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.