我想将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)