Openfire Server将自定义IQ发送到客户端

时间:2017-12-04 10:19:07

标签: plugins xmpp openfire

我想将Custom IQ发送到客户端,但是当我将数据包路由到客户端时,客户端会收到错误Socket closed by remote peer

这是我的代码:

    List<JID> jidList = this.getUserRooms(session);

    IQ iq = new IQ(Type.result);

    iq.setFrom("com.innovate.ygoa");
    iq.setTo(session.getAddress());

    for (JID jid : jidList) {
        Element item = DocumentHelper.createDocument().addElement("item");
        item.setText(jid.toString());
        iq.setChildElement(item);
    }
    XMPPServer.getInstance().getIQRouter().route(iq);
    //  XMPPServer.getInstance().getSessionManager().getSession(session.getAddress()).process(iq)

0 个答案:

没有答案