我正在使用XMPP服务器制作聊天应用程序。聊天应用程序运行良好,但我遇到了一个问题:在2个用户之间聊天时,我无法知道第一个用户的消息是否已到达服务器。使用XMPP服务器的聊天应用程序
那么如何知道来自第一个用户的消息是否到达服务器,而不必担心第二个用户是否在线或离线。
请帮助
我发送消息是这样的:
final SecureConnection sc = (SecureConnection)Connector.open("ssl://...", Connector.READ_WRITE);
is = sc.openInputStream();
os = sc.openOutputStream();
this.reader = new XmlReader(is);
this.writer = new XmlWriter(os);
public boolean sendMessage(final String to, final String msg) {
this.writer.startTag("message");
this.writer.attribute("type", "chat");
this.writer.attribute("to", to);
this.writer.startTag("body");
this.writer.text(msg);
this.writer.endTag();
this.writer.endTag();
this.writer.flush();
}
这种方法的作者是什么? – Lucifer 2012-01-17 11:07:24
这是一个xml编写器,将数据写入XMPP服务器 – 2012-01-17 11:10:51
当然,我知道,我想知道的是,它是哪个类的对象/变量? – Lucifer 2012-01-17 11:12:43