【发布时间】:2015-01-26 17:26:24
【问题描述】:
我正在尝试使用 Smack API 从 Java 连接 ejabberd 服务器。当我使用以下代码时,我可以连接到 ejabberd 服务器。
XMPPTCPConnection connection = new XMPPTCPConnection("localhost");
connection.connect();
但是,当我以下列方式使用 ConnectionConfiguration 时,它会显示连接异常或无响应错误。
ConnectionConfiguration conf = new ConnectionConfiguration("localhost",5280);
conf.setReconnectionAllowed(false);
XMPPTCPConnection connection = new XMPPTCPConnection(conf);
connection.connect();
我无法解决问题。请帮忙 。
【问题讨论】:
-
This question 看起来很相似。