简体   繁体   中英

Issue with establishing Openfire XMPP Connection Android on live server via Asmack

Issue with establishing Openfire XMPP Connection Android on live server via Asmack . I am unable to establish a connection with the server. The same code is working fine when i point it on a localhost but the issue occurs when pointed on live server.

Exception caught while establishing connection : Connection failed. No response from server

xmppConfig = new ConnectionConfiguration(Constants.XMPP_BASE_URL, Constants.XMPPP_PORT,Constants.XMPP_RESOURCE);
xmppConfig.setSASLAuthenticationEnabled(true);
xmppConfig.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
if (xmppConfig == null)
    throw new NullPointerException("XMPPService must be configured before it can connect!");
try {
    if (xmpp == null) {
        xmpp = new XMPPConnection(xmppConfig);
    }
    xmpp.connect();
    state = State.CONNECTED;
} catch (XMPPException ex) {
    Log.d(XMPPController.class.getName(), ex.toString());
}

Issue has been resolved. The issue actually existed on the server side. Some server side settings were blocking the use of open-fire. This issue is not existed on android side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM