gpt4 book ai didi

android - 使用 Smack 4.1 创建新组时获取 SmackException NoResponseException

转载 作者:行者123 更新时间:2023-11-29 01:23:30 25 4
gpt4 key购买 nike

我正在使用下面的代码创建多用户组,但出现超时错误,即使我的超时错误是 10 秒也是如此。

public void createGroup() {

String roomId = "Group_test003" + "@icoveri.com";
String nick = "Grouptest";

try {

MultiUserChatManager manager = multiUserChatManager.getInstanceFor(connection);

MultiUserChat muc = manager.getMultiUserChat(roomId);

muc.create(nick);

Form form = muc.getConfigurationForm();

Form submitForm = form.createAnswerForm();

List<FormField> fields = form.getFields();
for (int i = 0; i < fields.size(); i++) {
FormField field = (FormField) fields.get(i);
if (!FormField.Type.hidden.equals(field.getType()) && field.getVariable() != null) {

submitForm.setDefaultAnswer(field.getVariable());
}
}

List owners = new ArrayList();
owners.add(user1234 + "@icoveri.com");
submitForm.setAnswer("muc#roomconfig_roomowners", owners);

muc.sendConfigurationForm(submitForm);

} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException.NoResponseException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
} catch (SmackException e) {
e.printStackTrace();
}

}

我得到的错误是

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). Used filter: AndFilter: (FromMatchesFilter (full): Group_test003@iscoveri.com/Grouptest, StanzaTypeFilter: org.jivesoftware.smack.packet.Presence).

at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:229) at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:311) at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:400) at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:376)

最佳答案

我找到了解决方案。问题出在我的服务中,即 iscoveri.com。我必须使用不同的服务名称来创建组。

关于android - 使用 Smack 4.1 创建新组时获取 SmackException NoResponseException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35407056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com