diff options
author | Andy Pan <i@andypan.me> | 2025-05-21 14:43:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-21 08:43:53 +0200 |
commit | 3a9a6e3e6bc78565ddf94cf462c9877c1004bb62 (patch) | |
tree | d684b2e44f5dc44ac608ca681422dc9f33c142a6 /test/test-tcp-flags.c | |
parent | 71ec5c0fcdd867b64c46ade1e0a6b59101281a4a (diff) | |
download | libuv-main.tar.gz libuv-main.zip |
Implement `uv_tcp_keepalive_ex` function that extends
`uv_tcp_keepalive` to support `TCP_KEEPINTVL` and `TCP_KEEPCN`
socket options in addition to TCP_KEEPIDLE.
Diffstat (limited to 'test/test-tcp-flags.c')
-rw-r--r-- | test/test-tcp-flags.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test-tcp-flags.c b/test/test-tcp-flags.c index 16218a27..04a238b2 100644 --- a/test/test-tcp-flags.c +++ b/test/test-tcp-flags.c @@ -49,6 +49,21 @@ TEST_IMPL(tcp_flags) { r = uv_tcp_keepalive(&handle, 1, 0); ASSERT_EQ(r, UV_EINVAL); + r = uv_tcp_keepalive_ex(&handle, 1, 60, 60, 60); + ASSERT_OK(r); + + r = uv_tcp_keepalive_ex(&handle, 0, 0, 0, 0); + ASSERT_OK(r); + + r = uv_tcp_keepalive_ex(&handle, 1, 0, 10, 10); + ASSERT_EQ(r, UV_EINVAL); + + r = uv_tcp_keepalive_ex(&handle, 1, 10, 0, 10); + ASSERT_EQ(r, UV_EINVAL); + + r = uv_tcp_keepalive_ex(&handle, 1, 10, 10, 0); + ASSERT_EQ(r, UV_EINVAL); + uv_close((uv_handle_t*)&handle, NULL); r = uv_run(loop, UV_RUN_DEFAULT); |