Repository navigation
Conversation
The "Adapted byte timeout (7ms > 5ms)" check in unit-test-client relies on unit-test-server sending the reply one byte per send() with 5 ms between bytes. The server socket does not set TCP_NODELAY, so Nagle's algorithm may hold each byte until the previous one is acknowledged. On QNX 8.0 over IPv4 this pushes the gap past the 7 ms byte timeout and the check fails on every run (unit-test-client.c, "rc == 1"). Set TCP_NODELAY on the socket before sending the byte-by-byte reply so the test measures the library's byte timeout rather than the TCP stack's coalescing. Tested on QNX 8.0.0 (Raspberry Pi 4B, aarch64le, SDP 8.0 qcc): unit-tcp went from 0/10 to 10/10 passes; unit-tcppi, random-tcp and bandwidth-tcp still pass. Linux (Ubuntu 22.04, gcc): unit-test tcp and tcppi pass.
|
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
Author
|
@cla-bot check |
|
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
|
The cla-bot has been summoned, and re-checked this pull request! |
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.
The "Adapted byte timeout (7ms > 5ms)" check in
unit-test-clientrelies onunit-test-serversending the reply one byte persend(), 5 ms apart. The server socket doesn't setTCP_NODELAY, so Nagle's algorithm can hold each byte until the previous one is acknowledged. On QNX 8.0 over IPv4 this pushes the gap past the 7 ms byte timeout, and the check fails on every run (unit-test-client.c,rc == 1). The same suite over IPv6 (tcppi) passes.This sets
TCP_NODELAYon the socket before the byte-by-byte reply, so the test measures libmodbus's byte timeout rather than the TCP stack's coalescing. Only the test server changes; the library is untouched.Tested
qcc(gcc 12.2.0):unit-test tcpwent from 0/10 to 10/10 passes;tcppi,random-testandbandwidthtests still pass../configure && makewith no warnings;unit-test tcpandtcppipass.clang-formatand-Wall -Wextra -Werror.Not tested on Windows.
TCP_NODELAYandIPPROTO_TCPcome fromwinsock2.hthere, which the file already includes.I agree to the terms of the Contributor License Agreement (CLA.txt).