powered by Jive Software

Smack v4.1.3 XMPPTCPConnection.sendSmAcknowledgement() not been called

Version : 4.1.3

Class : XMPPTCPConnection

Method : sendSmAcknowledgement


When I try to override the sendSmAcknowledgement() method, I found it never been called.

Instead, you are calling sendSmAcknowledgementInternal().

** ** But sendSmAcknowledgementInternal() is a private method which I cannot override it.

 Can you please help me to find a way to do it or is there any workaround?

XMPPTCPConnection.sendSmAcknowledgement() is not a callback. What do you want to do?

I know it’s not a callback, I know it’s for xep-0198 send ack answer. I want to override it and send ack answer by myself(after packet processing finish)

I want to override it and send ack answer by myself(after packet processing finish)
If I understand you right, you want to signal the finished processing of a stanza to the other end of the XMPP stream. That’s not what SM acks are meant for. Use IQs instead.

OK, I encountered this issue:

  1. I was offline, somebody send me 100 messages.

  2. I’m go online, I will receive all the offline messages, but it takes some time. For example, when I receive 50 messages, I kill the app or the app crashed, all the rest messages will gone.

Because sending ack answer is faster than UI part(Store in database, show on screen), it’s in different thread. When the UI part receive 50 messages, all the ack answer have been sent out. the rest 50 message are in the memory and waiting for process. But now the app been killed or crashed the messages in memory will miss, am I right?

By right, if I enabled XEP-0198 there is no reason to encounter missing message issue.

The XEP-0198 based on ‘AckAnswer’ and ‘AckRequest’. And in this case, the ack answers have been sent out but the UI part did not finished, will encounter missing message issue.

So I try to override the sendSmAcknowledgement method and send ack answer by myself(after invokePacketCollectorsAndNotifyRecvListeners be called).

Which means after UI work finished, then call sendSmAcknowledgement.

Please correct me if I’m wrong, thank you.

Hi, did you find a solution for that?