开发者

XMPP server does not respond to Smack login request

开发者 https://www.devze.com 2022-12-20 09:29 出处:网络
I\'m trying to establish a connection to an XMPP server using smack. ConnectionConfiguration cf = new ConnectionConfiguration(\"jabber.ccc.de\");

I'm trying to establish a connection to an XMPP server using smack.

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

But whenever logging in I get an XMPPException (No response from the server.: ) and the socket gets closed.

Any ideas what's going wrong here?

Regards


Have you tried seeing what the actual XMPP data being sent to/from the server is?

Try adding this to your code at startup:

System.setProperty("smack.debugEnabled", "true");
XMPPConnection.DEBUG_ENABLED = true;


Try this one.

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");


Just put the following line before you make the connection.

SASLAuthentication.supportSASLMechanism("PLAIN");


This problem was addressed by a person called Davanum; see the link

The problem is : you are behind a slow internet connection. You need to increase time out for packet reply in smack config.

Strangely, you can get this problem, only the first time, after a boot of the client system (windows).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号