Subject: Sample for message receipt/ack
Hi,
I need a solution to verify if a message that has been sent to another client has been received. It would be nice to see if the message has been successfully dispatched to the server and then delivered to the recipient.
I tried different approaches without success.
1) I tried SendAndAck() but the Callback is never getting called.
2) I tried to add a Request to the message but I didn't get any response back in the OnMessage event.
I am using Openfire v.3.9.3
Thank you!
- Christoph
I need a solution to verify if a message that has been sent to another client has been received. It would be nice to see if the message has been successfully dispatched to the server and then delivered to the recipient.
I tried different approaches without success.
1) I tried SendAndAck() but the Callback is never getting called.
- Private Sub cmdSend_Click(sender As Object, e As System.EventArgs) Handles cmdSend.Click
- Dim msg = New Client.Message() With { _
- .Type = MessageType.chat, _
- .[To] = _jid, _
- .Body = rtfSend.Text, _
- .Id = Guid.NewGuid().ToString() _
- }
- _xmppClient.SendAndAck(msg, AddressOf SendAndAckCallback)
- End Sub
- Private Sub SendAndAckCallback(sender As Matrix.Xml.XmppXElement, e As Matrix.Xmpp.StreamManagement.Ack.AckEventArgs)
- 'this is never getting called.
- End Sub
2) I tried to add a Request to the message but I didn't get any response back in the OnMessage event.
- Private Sub cmdSend_Click(sender As Object, e As System.EventArgs) Handles cmdSend.Click
- Dim msg = New Client.Message() With { _
- .Type = MessageType.chat, _
- .[To] = _jid, _
- .Body = rtfSend.Text, _
- .Id = Guid.NewGuid().ToString() _
- }
- msg.Add(New Receipts.Request())
- _xmppClient.Send(msg)
- End Sub
- Private Sub OnMessage(sender As Object, e As MessageEventArgs)
- 'no receipt notification arrives here
- End Sub
I am using Openfire v.3.9.3
Thank you!
- Christoph