Skip to content

Configure TCP Socket to Prevent Transmit Delay - #16

Merged
psachs merged 2 commits into
masterfrom
optimize-tcp-connection-config
Sep 22, 2026
Merged

psachs merged 2 commits into
masterfrom
optimize-tcp-connection-config

Conversation

@lsigrist

Copy link
Copy Markdown
Contributor

Enables TCP_NODELAY options on the TCP socket for SHDLC communication to remove Nagle as potential latency contributor.

Background
This setting disables Nagle's algorithm that delays to combine potential additional data into a single TCP frame transmission. With the relayed SHDLC protocol following a strict command/response scheme and the transmit path submitting the full frame in one socket send, it is guaranteed that no additional data follow any send of a command frame. Disabling Nagle allows immediate transmit of the command frame without potential wait for additional data.

Expected Benefit
Close to zero latency reduction, as with command/response scheme Nagle should not delay transmit on idle connection. Disabling Nagle makes immediate send explicit, documents it, and prevents Nagle being a source for unexpceted (future) latency increase.

@lsigrist lsigrist self-assigned this Sep 10, 2026
@lsigrist
lsigrist force-pushed the optimize-tcp-connection-config branch from d86584f to 04b1ea4 Compare September 10, 2026 13:22

@dstraessler dstraessler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@lsigrist lsigrist changed the title Reduce TCP Connection Latency Configure TCP Socket to Prevent Transmit Delay Sep 10, 2026
@lsigrist
lsigrist requested a review from psachs September 22, 2026 07:35
@psachs
psachs merged commit c881f2e into master Sep 22, 2026
13 checks passed
@psachs
psachs deleted the optimize-tcp-connection-config branch September 22, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants