SMACKException: The following addresses failed: 'localhost:5222' failed because java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 5222) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused)
XMPPTCPConnectionConfiguration.Builder config =
XMPPTCPConnectionConfiguration
.builder();
config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
config.setServiceName("localhost");
config.setHost("localhost");
config.setPort(5222);
config.setDebuggerEnabled(true);
XMPPTCPConnection.setUseStreamManagementResumptiodDefault(true);
XMPPTCPConnection.setUseStreamManagementDefault(true);
connection = new XMPPTCPConnection(config.build());
XMPPConnectionListener connectionListener = new
XMPPConnectionListener();
connection.addConnectionListener(connectionListener);
Please help me on it. Thanks in Advance