1

我正在尝试使用 smack 建立与 XMPP 服务器的连接。

ConnectionConfiguration cf = new ConnectionConfiguration("jabber.ccc.de");
cf.setTruststorePassword("changeme");
this.connection = new XMPPConnection(cf);
this.connection.connect();
this.connection.login("user", "password");

但是每当登录时,我都会收到 XMPPException (No response from the server.: ) 并且套接字被关闭。

任何想法这里出了什么问题?

问候

4

4 回答 4

2

您是否尝试过查看发送到服务器/从服务器发送的实际 XMPP 数据是什么?

尝试在启动时将其添加到您的代码中:

System.setProperty("smack.debugEnabled", "true");
XMPPConnection.DEBUG_ENABLED = true;
于 2010-02-15T17:58:25.747 回答
0

一个叫 Davanum 的人解决了这个问题。看链接

问题是:您的互联网连接速度较慢。您需要在 smack 配置中增加数据包回复的超时时间。

奇怪的是,您只会在第一次启动客户端系统(Windows)后遇到此问题。

于 2010-06-24T05:23:52.963 回答
0

试试这个。

ConnectionConfiguration cf = new ConnectionConfiguration("jabber.ccc.de",5222, "test");
cf.setTruststorePassword("changeme");
this.connection = new XMPPConnection(cf);
this.connection.connect();
this.connection.login("user", "password");
于 2010-07-09T08:33:48.707 回答
0

只需在建立连接之前输入以下行。

SASLAuthentication.supportSASLMechanism("PLAIN");
于 2010-11-01T11:59:56.063 回答