Archived

This forum has been archived. Please start a new discussion on GitHub.

AMI -- How to determine when a message has been sent successfully

Hi,

using asynchronous message invocation, I want to maintain a counter for the messages which are not yet sended. When calling begin_<function>(), the counter is incremented. Using the Ice Callback interface, there are two callback functions, sent() and completed(). As far as I understood, sent() means the message has been written to local transport (what does that mean exactly?), completed() means it has been processed on the server. Is there any way to get a callback when the message has been successfully transmitted (comparable to a TCP-ACK), but not necessarily processed?

Thanks in advance and best regards
Thomas

Comments

  • mes
    mes California
    Hi Thomas,

    Welcome to the forum.

    The sent callback indicates that Ice has handed the entire message off to the operating system. As far as Ice is concerned, the message is considered to be "sent", since Ice doesn't have any further control over it. In other words, Ice has done the best it can do to ensure the message has been sent.

    For a twoway invocation, the completed callback indicates that the operation has completed, and resulted in either a successful result or an exception of some kind.

    The Ice protocol does not currently provide an equivalent to an ACK message, to indicate that the server has successfully received a message, although I can see how that would be useful in some situations.

    Of course, you can also implement something like an ACK message at the application level, but it would add some complexity to your code.

    Regards,
    Mark