【发布时间】:2023-04-09 01:15:01
【问题描述】:
如何使用有效负载在 pubsub 节点上发送/接收自定义项目,我使用的是 qsmack lib。
这是我的代码。
StringBuilder strBuffer = new StringBuilder();
strBuffer.append("<x xmlns=");
strBuffer.append("jabber:x:data");
strBuffer.append(">Test</x>");
String xml = strBuffer.toString();
SimplePayload item = new SimplePayload("test1111","pubsub_test_book", xml);
// 使用有效负载发布项目
leafNode.send(new PayloadItem<SimplePayload>("test123", item));
当我尝试在节点上发送有效负载项时,我从服务器收到一条错误消息,服务器没有响应并且连接断开。
【问题讨论】:
标签: android xmpp publish-subscribe