Event Window using the Sequence and Ack Fields
Each response has an ever increasing sequence number for each event within the event array. The sequence number works in the spirit of a TCP sliding window: the responses increment the sequence number and the next request (POST) acknowledges the most recent successful sequence number. Successful means that the command has been processed by the TFT Router without error and can be safely removed from the TSSRegistry™ Event Queue.
When a POST is received at the TSSRegistry, the POST contains an “ack” field. The value of the “ack” is the sequence number of the most recent successful event (command) processed by the TFT Router. For example, if an ack with value 100 is sent by the TFT Router in the POST, then the TSSRegistry assumes that all commands prior to, and including, that sequence number have been acknowledged as successful (consumed) and can be removed from the TSSRegistry Event Queue. This means that selective acknowledgements are not allowed.
Initial Sequence Response
When a TFT Router is initially brought online, the very first time a download is requested, the ack in the POST MUST start with 0. From that point forward, the ack is relative to the prior POST/response. The first download event has a sequence number of 1.
Sequence Number Rollover
When the maximum sequence number in the response is sent, the next sequence number returns to 0 (rolls over).
Maximum Unacknowledged Events
The maximum number of events that are allowed to be outstanding (not acknowledged by the TFT Router) is 1,000. Before the number of unacknowledged events exceeds this value, the TFT Router must acknowledge some of its consumed events (and move the sliding event window forward). Any attempt by the TFT Router to request more events than this maximum results in the TSSRegistry responding with a permanent error, implying a coding error at the TFT Router. Refer to the Error Detection and Error Communication section within this document.