简体   繁体   English

通过Asmack在实时服务器上建立Openfire XMPP Connection Android的问题

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

Issue with establishing Openfire XMPP Connection Android on live server via Asmack . 通过Asmack在实时服务器上建立Openfire XMPP Connection Android的问题。 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. android端不存在此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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