The resending is not necessarily undesirable. In the case of ADT, we want to make sure that a given message is delivered even if we time out waiting for a response.
When matching message control IDs (MCID) you simply need to discard any ACK with an MCID other than the one you’re waiting for.
Let’s take my example:
–> message 1.1 (times out)
–> message 1.2 (resend)
ACK(1.1) <–
–> message 2
ACK(1.2) ( response to resent message 1.2) <–
–> message 3
ACK(2) <–
–> message 4
ACK(3) <–
In this situation, we would accept the first ACK(1.1) for the resent message 1.1. Then, when we send message 2, we receive the second ACK(1.2) which would be discarded since its MCID is not the one we’re waiting for (just like the Star Wars droids). We would then receive ACK(2) and accept it as ACK for message 2. At that point, we’re back in sync.
This is where my expertise evaporates…
How would we modify cl_check_ack to discard an ACK with a non-matching MCID and continue to wait for an ACK with a matching MCID?
In this excerpt from cl_check_ack, the “good” ACK case kills both the received ACK ($mh) and the sent message ($my_mh).
AA – CA {
# Good ACK – Clean up
set send_cnt 0 ;# Init counter
return “{KILLREPLY $mh} {KILL $my_mh}”
}
If we kill just the reply – something like this (assuming we build code to set matching_mcid properly):
AA – CA {
# Good ACK – Clean up
if { ! $matching_mcid } {
return “{KILLREPLY $mh}”
} else {
set send_cnt 0 ;# Init counter
return “{KILLREPLY $mh} {KILL $my_mh}”
}
}
Will that have the desired effect of discarding the superfluous ACK and moving on to the next one – or will it just leave $my_mh adrift somewhere in the ether?
Jeff Dinsmore
Chesapeake Regional Healthcare