tcp nodelay to avoid batching TCP packets, handle multi-frame messages/packets#15
Merged
Conversation
Contributor
Author
|
With fix: Before Fix: |
zeerekahmad
reviewed
May 21, 2026
zeerekahmad
reviewed
May 21, 2026
zeerekahmad
reviewed
May 21, 2026
added 2 commits
May 21, 2026 14:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix 1: Add the TCP Nodelay- batching the TCP packets with the default behavior of the TCP socket resulted in many dropped packets (see comment).
Fix 2: Handle multiple protocol messages in the TCP buffer - the driver's receive callback on the TCP stream made an assumption that there would only be a single AXIO protocol message within a single receive buffer from the TCP message. After this fix, it iterates through the TCP buffer to find any additional AXIO prefixed protocol messages
Fix 3: Handle multiple CAN Frames within a single AXIO Protocol message. Each AXIO prefixed protocol message can have more than a single CAN Frame packed inside of it. The previous iteration of the driver ignored any frames beyond the first one. This fix iterates through all the possible CAN Frames
Potential Fix 4: Increase the buffer size to prevent any chance of overflow on the receive buffer reaching the end. Not observed but a cautious forward looking fix. Also sets the buffer once as a member variable instead of creating a new buffer on the heap per-receive for minor efficiency boost
Known Remaining Issues: