Following is the log captured on aTalk upon user login. From the log, there are a total of 5 stanzas sent from server and received by smack, however only 3 out of 5 status update are relayed via PresenceEventListener to the app. Just to ensure that aTalk is not loading on Smack leading to the problem, presenceChanged() method contains only one single print statement in the testing i.e.
@Override
public void presenceChanged(final Presence presence)
{
logger.info("Smack presence update for: = " + presence.getFrom() + " - " + presence.getType());
// firePresenceStatusChanged(presence);
}
I also tried the followings, instead of using presenceChanged() event, I included aTalk own addAsyncStanzaListener(), addSyncStanzaListener with or without StanzaTypeFilter.PRESENCE,
the result remains unchanged i.e. the 2 missing stanzas are not received by the StanzaListener at all.
I included a debug log message right at the XMPPConnection#parsePackets(), after case Presence.ELEMENT: , and found that all the missing stanzas are also not received by this method i.e. class PacketReader().
switch (name) {
case Message.ELEMENT:
case IQ.IQ_ELEMENT:
case Presence.ELEMENT:
LOGGER.log(Level.WARNING,"### Stanza received: " + name);
I disabled the Smack debugger, from the log messages, again I see there is no change to the result.
I also found out that total time taken for parseAndProcessStanza(parser) is from 7~32ms in my test cases;
possibly that this has led to the observed problem?
-
Can it be possible that the stanza streaming from server is too fast for Smack to handle?
The stanzas is only separated by only 1~4 ms of each other. -
Is the PacketReader class designed only to read the stream input at fixed interval e.g. 10mS, hence it misses all the packets arrive during the silent wait period?
-
What is different between Smack Debugger and the PacketReader, SmackDebuuger is able to see all the incoming stanzas but not the PacketReader? Any explanation.
-
Is there anything else I can try to find the cause of the problem?
======= aTalk log on <presence/> stanza ==========
06-01 18:34:32.545 608-1321/org.atalk.android D/SMACK: RECV (0): <presence xmlns="jabber:client" id="lKCk0-2123" from="test6@example.org/atalk">
<status />
<priority>35</priority>
<show>chat</show>
<x xmlns="vcard-temp:x:update" />
<c xmlns="http://jabber.org/protocol/caps" node="http://android.atalk.org" hash="sha-1" ver="SPANeHrMhKxipyDRRXFZu1T21So=" />
</presence>
06-01 18:34:32.548 608-1321/org.atalk.android D/SMACK: RECV (0): <presence xmlns="jabber:client" id="oDR64-283" from="test1@example.org/atalk">
<status />
<priority>30</priority>
<c xmlns="http://jabber.org/protocol/caps" node="http://android.atalk.org" hash="sha-1" ver="SPANeHrMhKxipyDRRXFZu1T21So=" />
<x xmlns="vcard-temp:x:update" />
</presence>
06-01 18:34:32.549 608-1321/org.atalk.android D/SMACK: RECV (0): <presence xmlns="jabber:client" from="test2@example.org/test2">
<show>away</show>
<status>Ich bin gerade nicht hier</status>
<query xmlns="jabber:iq:last" seconds="302" />
<c xmlns="http://jabber.org/protocol/caps" node="http://pidgin.im/" hash="sha-1" ext="voice-v1 camera-v1 video-v1" ver="lV6i//bt2U8Rm0REcX8h4F3Nk3M=" />
<x xmlns="vcard-temp:x:update">
<photo>e3e1301f50e9c0ec70ab7a74e2fe584d05ba0d5d</photo>
</x>
</presence>
06-01 18:34:32.553 608-1321/org.atalk.android D/SMACK: RECV (0): <presence xmlns="jabber:client" id="C78YU-13" from="test7@example.org/jitsi-1t0srj5">
<status />
<priority>30</priority>
<x xmlns="vcard-temp:x:update">
<photo />
</x>
<c xmlns="http://jabber.org/protocol/caps" hash="sha-1" ext="" node="http://jitsi.org" ver="yrwYh3KH39OWQUWRdU4fOGclT5I=" />
</presence>
06-01 18:34:32.787 608-1321/org.atalk.android D/SMACK: RECV (0): <presence xmlns="jabber:client" from="example.org" />
06-01 18:34:32.588 608-1708/org.atalk.android I/aTalk: [45844] impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.presenceChanged().1173 Smack presence available for: = test6@example.org/atalk
06-01 18:34:32.620 608-1709/org.atalk.android I/aTalk: [45845] impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.presenceChanged().1173 Smack presence available for: = test7@example.org/jitsi-1t0srj5
06-01 18:34:32.828 608-1711/org.atalk.android I/aTalk: [45846] impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.presenceChanged().1173 Smack presence available for: = null