我能够连接到我的本地服务器(韵律),但是当我尝试连接托管服务器时,我无法连接。
这是我的连接请求
XMPPTCPConnectionConfiguration.XMPPTCPConnectionConfigurationBuilder builder =
XMPPTCPConnectionConfiguration.builder();
builder.setServiceName("my_service_name");
builder.setHost("xx.xx.xxx.xxx"); // my host name
builder.setPort(5281); // myport name (i have used 5281 for https as per the prosody docs )
builder.setUsernameAndPassword(mUsername, mPassword);
builder.setRosterLoadedAtLogin(true);
builder.setResource("Rooster");
mConnection = new XMPPTCPConnection(builder.build());
mConnection.addConnectionListener(this);
mConnection.connect();
mConnection.login();
当我尝试连接时,出现如下所示的 XmppPullparser 异常,请帮助我。
W/AbstractXMPPConnection: Connection closed with error
org.xmlpull.v1.XmlPullParserException: Unexpected token (position:TEXT HTTP/1.1 400 Bad...@8:1 in java.io.BufferedReader@2d9e3b7)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:440)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:321)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1170)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPConnection.java:931)