The server resends a message when it gets no ack. How do you avoid showing it twice?
Sketch your own answer first, then compare it with the one below.
A strong answer
The server cannot tell a lost message from a lost ack, so it resends in both cases. That is at-least-once delivery.
The client keeps the sequence numbers it has and drops a message it already holds. For messages the client sends, a client-made message id lets the server drop a repeat. The result looks like exactly once, built from at-least-once delivery and a duplicate check.
Sources
- Leslie Lamport (1978). Time, clocks, and the ordering of events in a distributed system.