Question: How I could use stream management? (#144)
Unknown opened 4 years ago

Following the specification of stream management, I could use the <r> and <a> ensuring the messages the server sends are received for the server and vice-versa... how could I ensure when I'm sending a message that a message was sent before continue sending other messages?

Unknown commented 4 years ago

Why would you need that check? Any stanza sent using then API will be delivered before another stanza (they are queued internally), so you can just send stanza one after another and the will be delivered (to the server) in proper order.

Also, TigaseSwift has support for StreamManagement already in the library - it is used if available by default. All you need to do, is to register StreamManagementModule module.

Unknown commented 4 years ago

@hantu85 I want to connect in the background, send a message according to the received push notification, and then disconnect from the server but I want to ensure it was sent the stanza before disconnect.

Unknown commented 4 years ago

I think that you could just send a message and then call disconnect() and wait in completionHandler for it to complete. This library will send message to the server (flush outgoing stanza queue) before disconnecting. If disconnection would be reported as clean by DisconnectedEvent message should be properly delivered to the server and connection would be properly closed.

If server properly handles all incoming stanzas before closing the stream (as it should according to the protocol specification) then message should be properly delivered to the XMPP server.

Unknown commented 4 years ago

Ok, thanks.

issue 1 of 1
Issue Votes (0)
Watchers (0)
Reference
tigase/_libraries/Martin#144
Please wait...
Page is in error, reload to recover