Open Fire Connection failed: Unable to resolve host in Live Server

I my Android chat application

I have configured to local server and its works perfectly, with following code:

private final String mServiceName=“192.168.0.118”;
private final String mHostName=“192.168.0.118”;
private final int mPort = 5222;

But when I Change to Live Server, I am getting following error:

private final String mServiceName=“example.com”;

private final String mHostName=“domain.example.com”;

private final int mPort = 5222;

Log

org.jivesoftware.smack.SmackException$ConnectionException: The following addresses failed: ‘racoalert.tiatechusa.com:5222’ failed because java.net.SocketTimeoutException: failed to connect to domain.example.com/198.0.111.216 (port 5222) after 30000ms

Code to connect to server is given below:

XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();

builder.setServiceName(mServiceName);

builder.setPort(mPort);

builder.setHost(mHostName);

builder.setDebuggerEnabled(true);

builder.setSendPresence(true);

builder.setResource(SampleApp.getDeviceID());

builder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);

Hi Viji,

I am also facing the same error. If you found a solution, could you please share it with me. I will be so grateful. I have being searching all over Google but to no avail. @Matt Tucker Openfire Support @wroot

1 Like

Hi

anybody solve this problem because im also facing same problem. openfire v4.0.2 open fire support

My Problem is solved.

open 5222 port in live server.