Restart ACK timer every time a message is sent #2517
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short description of changes
Start or restart the message ack timer every time a protocol message is sent, so that the ack timeout
works correctly at all times.
CHANGELOG: Client/Server: corrected operation of message ack timer.
Context: Fixes an issue?
The original code only started the timer if it was not already active. This failed to restart the ack timer for each sent message. The timer is a free-running repeated timer, so this meant that if a lot of messages were queued up at once (such as from a MIDI controller, see #2492, and second bullet point in #2492 (comment)), the timer only got started for the first message, and fired every 400ms while the queue was not empty. So later messages sent from the queue could be considered prematurely unacked every 400ms from the sending of the first message, and re-sent unnecessarily.
QTimer::start()will restart a running timer, so is safe to call without checking for active.Does this change need documentation? What needs to be documented and how?
No, bug fix only.
Status of this Pull Request
Tested. Packet trace from
mastershowed frequent repeated messages. Packet trace from this branch did not.What is missing until this pull request can be merged?
Ready to merge
Checklist