Commit 84a4e237 authored by Andreas Schneider's avatar Andreas Schneider Committed by Michael Adam

tests: Add test for TCP_NODELAY setsockopt()

Signed-off-by: default avatarAndreas Schneider <>
Reviewed-by: default avatarMichael Adam <>
parent 96dbeb75
......@@ -325,6 +325,17 @@ static void test_sockopt_tcp(void **state)
assert_return_code(rc, errno);
assert_int_equal(opt, 0);
opt = 1; /* Turn on TCP_NODELAY */
optlen = sizeof(int);
rc = setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, optlen);
assert_return_code(rc, errno);
opt = -1;
optlen = sizeof(int);
rc = getsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen);
assert_return_code(rc, errno);
assert_int_equal(opt, 1);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment