Smack4.1 No response received within reply timeout

HI,everyone:

When I making a xmpp connection, i receving a Exception below:

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Used filter: No filter used or filter was ‘null’.

the openfire version is 3.9.3 and the smack version is 4.1.0

my android code below:

======================================================

try {

XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()

.setUsernameAndPassword(“aaa”, “aaa”)

.setHost(“192.168.1.105”) //my IP address

.setServiceName(“adaofu”) //my Server Name

.setPort(5222)

.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)

.setCompressionEnabled(false)

.build();

conn = new XMPPTCPConnection(config);

conn.connect();

} catch (SmackException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

} catch (XMPPException e) {

e.printStackTrace();

}

================================

Where is the problem?

Thanks in advance

johnson

who can resolve my question ?

Even I am facing the same issue.

Even I have the same problem. Nobody seems to be solving it. were you able to get it ?

Yes,
I am able to connect to My Openfire Server now.
Below is my working code:

XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()

.setServiceName(HostName)

.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)

.setDebuggerEnabled(true).build();

mConnection = new XMPPTCPConnection(config);

try {

System.out.println(“connecting”);

mConnection.setPacketReplyTimeout(10000);

mConnection.connect();

System.out.println(“connected”);

mConnection.login(username, password);

} catch (SmackException | IOException | XMPPException e) {

e.printStackTrace();

}

where mConnection is the instance of AbstractXMPPConnection.

If this piece of code doesnt work for you,then there must be some problem in the Openfire server configuration.