Smack 4.1.9 Login Time out error

Hello all , I am having an issue and that is i am unable to authenticate my connection after switching network 3-4 times.

To reproduce issue please do the following step

Switch to 3g or 2g then again to wifi , again to 3g/2g and again to wifi … after doing this 4-5 times , at some stage connection gets connected but it is unable to login

and give error :No response received within reply timeout. Timeout was 40000s (~40s). Used filter: No filter used or filter was ‘null’ (which i am setting like this -> connection.setPacketReplyTimeout(40000); )

i am also using stream management like this.

static {

XMPPTCPConnection.setUseStreamManagementDefault(true);

XMPPTCPConnection.setUseStreamManagementResumptionDefault(true);

}

and Reconnection manager like this .

ReconnectionManager.getInstanceFor(connection).setFixedDelay(10);
ReconnectionManager.getInstanceFor(connection).enableAutomaticReconnection();

SASL SETTINGS :

SASLAuthentication.unBlacklistSASLMechanism(“PLAIN”);

SASLAuthentication.blacklistSASLMechanism(“DIGEST-MD5”);

All the other settings host , port and everything is fine infect the whole code is working fine for stable internet connection , but when i switch network again and again or internet become unstable this issue arises. (Smack Exception : Time out from server was 40000s )

This issue arises frequently, when the internet is slow…

I have searched a lot but unable to find what is wrong. Thanks in advance !

Which Smack version?

Sir its 4.1.9

Please see How to ask for help, report an issue and possible solve the problem yourself · igniterealtime/Smack Wiki · GitHub

i have already read this article… and i am unable to find anything which is authentic answer to my scenario…