XMPP aSmack MultiUserChat服务器继续发送已经收到的邮件 [英] XMPP aSmack MultiUserChat server continues to send already received messages

查看:348
本文介绍了XMPP aSmack MultiUserChat服务器继续发送已经收到的邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我'在栈上一个新用户,但我有MultiUserChat一个问题aSmack库3.2.1机器人。我使用gtalk.google.com服务器。这是一个简单的例子,我'只有一个房间:

I'am a new user on stack, but I have a problem with MultiUserChat in aSmack library 3.2.1 for android. I'm using "gtalk.google.com" server. It's a simple example and I'am only one in room:

 String room="myConference@conference.jabber.org";
 MultiUserChat muc = new MultiUserChat(connection,room);
 muc.join(userNameInRoom);

 muc.addMessageListener(new PacketListener()
 {
    @Override
    public void processPacket(Packet packet)
    {
         ...
    }
 });

 muc.sendMessage("Text message");

在日志:

DEBUG/SMACK(281): 06:46:29 PM SENT (1140866576): <message id="gsMe7-18"
to="myConference@conference.jabber.org" type="groupchat"><body>Text message
</body></message>

DEBUG/SMACK(281): 06:46:29 PM RCV  (1140866576): <message
from="myConference@conference.jabber.org/userNameInRoom" to="userName"
type="groupchat"><body>Text message</body></message>

结果:短信,这是正确的,但后来:

Result: "Text message" and it is right, but then:

我再次:收到短信与presences:

I again recieved "Text message" with presences:

DEBUG/SMACK(281): 06:54:12 PM RCV  (1140866576): <presence 
from="myConference@conference.jabber.org/userNameInRoom" to="userName"><x xmlns=
"vcard-temp:x:update"><photo/></x><x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="owner" role="moderator"/><status code="110"/></x></presence>

DEBUG/SMACK(281): 06:54:12 PM RCV  (1140866576): <message 
from="myConference@conference.jabber.org/userNameInRoom" to="userName"
type="groupchat"><body>Text message</body><delay stamp="2012-02-15T17:46:31Z" 
from="myConference@conference.jabber.org" xmlns="urn:xmpp:delay"/><x 
stamp="20120215T17:46:31" from="myConference@conference.jabber.org" 
xmlns="jabber:x:delay"/></message>

和我收到了一遍又一遍,每当服务器发送presences给我。它继续无限区间〜5分钟。而且是在30分钟内我收到〜6的消息短信。如果我发送超过1消息,这些消息将得到:收到不例外,当presence发送给我。

And I recieved that again and again whenever server send presences to me. It continues infinitely with interval ~ 5 minutes. And Yes in 30 minutes I recieved ~6 messages "Text message". If I send more than 1 message all of these messages would been recieved without exceptions when presence send to me.

有什么问题,我MultiUserChat什么延迟交货在这里做什么?

What problem with my MultiUserChat and what delayed delivery doing here?

感谢您的关注!

推荐答案

对于@ conference.jabber.org我没有找到解决方案,我决定,因为GTalk的服务器和正确的版本MultiUserChat是在这个问题例@ groupchat.google.com。

In case of "@conference.jabber.org" I didn't find solution and I decided that problem because of GTalk server and correct version of MultiUserChat is in case with "@groupchat.google.com".

我改变了我的code的:

I changed my code from:

room=roomName+"@conference.jabber.org";
MultiUserChat muc = new MultiUserChat(connection, room);

muc.create(userName);

muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));

room="private-chat-" + UUID.randomUUID().toString() + "@groupchat.google.com";
MultiUserChat muc = new MultiUserChat(connection, room);

muc.join(userName);

muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));

和我尝试过,但我得到了新的problem-当用户接受她邀请消息,并接受这两个客户端崩溃的是 XmlPullExceptionEND_TAG预计,然后像&LT; /流:物流>在logcat中最后一个位置。

And i tried it, but I got new problem- When user recieve invite message and accept it both clients crash with XmlPullException "END_TAG expected" and something like "< /stream:stream>" in last position in logcat.

我开始谷歌这个问题,并找到原因。我用asmack从BEEM客户端(顺便说一下,在这之前我用asmack-7从asmack开发),以及如何我知道它是基于咂嘴3.1 ...我发现嫌3.2.0决定这个问题。我下载了 asmack流量的版本,我很高兴这一点。

I started to google this problem and found reason. I used asmack from beem client(by the way, before that i used asmack-7 from asmack developer) and how i know it is based on smack 3.1... I found that smack 3.2.0 decided this problem. I downloaded the Flow's version of asmack and I am pleased with this.

在最后,我想说:谢谢你!以流量为正确的版本aSmack,其工作比别人更好的。

In conclusion I want to say "Thank you!!!" to Flow for correct version of aSmack, which works better than others.

这篇关于XMPP aSmack MultiUserChat服务器继续发送已经收到的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆