"没有来自服务器的响应。"对于Android中的MutliUserChat

时间:2014-11-23 11:19:00

标签: android xmpp smack muc

我正在尝试在Android中为MultiUserChat创建一个房间。这是我的尝试:

String mNickName = "7799963";
String mGroupChatName = "room@confrence.mytestserver.net"; // Room Name
MultiUserChat mMultiUserChat;

mMultiUserChat = new MultiUserChat(mXMPPConnection, mGroupChatName);
try {

    mMultiUserChat.create(mNickName);
    mMultiUserChat.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
    mMultiUserChat.join(mNickName);
} catch (XMPPException e) {

    e.printStackTrace();
}

但我没有得到回应,这是我的logcat:

11-23 15:58:54.580: W/System.err(16749): No response from server.: 
11-23 15:58:54.610: W/System.err(16749):    at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:359)

任何人都可以指导我错误或任何解决方案吗?

1 个答案:

答案 0 :(得分:0)

final MultiUserChat muc = new MultiUserChat(connection, roomsName+ "@conference." + connection.getServiceName());    

// The number of chat room services will decide to accept the
// historical record
// muc.create(roomsName);

DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(0);
// history.setSince(new Date());
// Users to join in the chat room
// if (user.equals("meet")) {
// muc.invite("Kishan@54.76.159.35", "Invitation From Rajan");
muc.join(user, password, history,
    SmackConfiguration.getPacketReplyTimeout());

在此代码中您必须添加:

  1. 连接实例。
  2. 自定义RoomName。
  3. 我可以在开火中创建群组。