Smack 4.4.6: ReconnectionManager sometims stops trying if stream resumption is enabled


I’m trying to build an android application using Smack 4.4.6 and OpenFire 4.7.4. I have reached a point where I need to have a stable connection and I’m struggling a little with the ReconnectionManager not trying to reconnect in some cases.

After some debugging I think I know what is happening:

The XMPPTCPConnection.shutdown method returns and does not set the connected flag to false if the connection is resumeable. Based on the comment I understand why this is but it seams to break the ReconnectionManager retry loop since it is only checking the connected flag.

Shouldn’t the ReconnectionManager check if the connection is disconnected or if it is disconnected but resumeable?

I’m thinking something like this tough I’m not sure if it brakes anything else:

private boolean isReconnectionPossible(XMPPConnection connection) {
    return !done 
            &&  (!connection.isConnected() || connection.isDisconnectedButResumeable())
            && isAutomaticReconnectEnabled();
1 Like