同时发布到节点从服务器无响应

编程入门 行业动态 更新时间:2024-10-15 00:25:28
本文介绍了同时发布到节点从服务器无响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想获得该节点(在Android中使用 asmack 库),并试图在发布该节点的一些内容,但遗憾的是当节点=(叶节点)mgr.getNode(nodeNameTxt.getText()的toString()); 行被执行我收到以下错误

I am trying to get the node (in android and using asmack library ) and trying to publish some content over that node , but unfortunately when node = (LeafNode) mgr.getNode(nodeNameTxt.getText().toString()); line gets executed i am getting following error

No response from server.: at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.java:50) at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.java:61) at org.jivesoftware.smackx.pubsub.PubSubManager.getNode(PubSubManager.java:161) at com.bcl.NodeManager.publishNode(NodeManager.java:176) at com.bcl.NodeManager.access$1(NodeManager.java:167) at com.bcl.NodeManager$2.run(NodeManager.java:101) at java.lang.Thread.run(Thread.java:1019)

下面是我的code

PubSubManager mgr = new PubSubManager(xmpp, "pubusb.example"); // Get the node LeafNode node; try { //HERE I AM GETTING THE ERROR node = (LeafNode) mgr.getNode(nodeNameTxt.getText().toString()); node.send(new PayloadItem("test" + System.currentTimeMillis(), new SimplePayload("book", "pubsub:test:book", ""))); } catch (XMPPException e) { // TODO Auto-generated catch block e.printStackTrace(); }

即使在以下行得到执行我得到了同样的错误。

even when a following line get executed i am getting the same error

createLeaf = mgr.createNode(nodeNameTxt.getText().toString());

我真的不知道发生了什么,因为我已设置 SmackConfiguration.setPacketReplyTimeout(10000); 和服务器运行良好与stophe的JavaScript样本也。

I really dont know whats happening as i have set SmackConfiguration.setPacketReplyTimeout(10000); and server is running fine with stophe javascript sample also.

推荐答案

我怀疑到地址不正确,并在服务器的数据包不会被发送到发布订阅服务。尝试初始化您的pubsub经理这样。

I suspect that the "to" address is incorrect and the packet is not being sent to the pubsub service in your server. Try initializing your pubsub manager like this.

PubSubManager mgr = new PubSubManager(xmpp, "pubsub.xmppdomain");

其中xmppdomain当然是你的实际的XMPP域。

where xmppdomain is of course your actual xmpp domain.

您可以用smack.debugEnabled上运行(或任何Android的当量)检查XML的形式发送,确认这是要去的地方是应该的。

You can run with smack.debugEnabled on (or whatever the android equivalent is) to check the XML being sent, to confirm it is going where it should be.

更多推荐

同时发布到节点从服务器无响应

本文发布于:2023-10-11 14:16:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1481941.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   服务器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!