From 80097bd2f8e9b19a796bc0245726a6162ee3e260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Lindel=C3=B6w?= Date: Thu, 22 Oct 2026 11:36:17 +0200 Subject: [PATCH 1/3] Add test for tcs_opt_ip_no_delay_set --- tests/tests.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/tests.cpp b/tests/tests.cpp index 595f598..169aa3e 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -1542,6 +1542,62 @@ TEST_CASE("TCS_SO_OOBINLINE") REQUIRE(tcs_lib_cleanup() == TCS_SUCCESS); } +TEST_CASE("TCS_TCP_NODELAY") +{ + // Setup + REQUIRE(tcs_lib_init() == TCS_SUCCESS); + + // Given + TcsSocket socket_false = TCS_SOCKET_INVALID; + TcsSocket socket_true = TCS_SOCKET_INVALID; + TcsSocket socket_null = TCS_SOCKET_INVALID; + + CHECK(tcs_socket(&socket_false, TCS_FAMILY_IPV4, TCS_SOCKET_STREAM, TCS_PROTOCOL_IP_TCP) == TCS_SUCCESS); + CHECK(tcs_socket(&socket_true, TCS_FAMILY_IPV4, TCS_SOCKET_STREAM, TCS_PROTOCOL_IP_TCP) == TCS_SUCCESS); + + // When + CHECK(tcs_opt_ip_no_delay_set(socket_false, false) == TCS_SUCCESS); + CHECK(tcs_opt_ip_no_delay_set(socket_true, true) == TCS_SUCCESS); + CHECK(tcs_opt_ip_no_delay_set(socket_null, true) == TCS_ERROR_INVALID_ARGUMENT); + + // Then + bool socket_false_value = true; + bool socket_true_value = false; + bool socket_null_value = false; + CHECK(tcs_opt_ip_no_delay_get(socket_false, &socket_false_value) == TCS_SUCCESS); + CHECK(tcs_opt_ip_no_delay_get(socket_true, &socket_true_value) == TCS_SUCCESS); + CHECK(tcs_opt_ip_no_delay_get(socket_null, &socket_null_value) == TCS_ERROR_INVALID_ARGUMENT); + CHECK(tcs_opt_ip_no_delay_get(socket_true, NULL) == TCS_ERROR_INVALID_ARGUMENT); + + CHECK(socket_false_value == false); + CHECK(socket_true_value == true); + + // The option must end up as TCP_NODELAY on the TCP level, verify through the raw option API + int native_false = -1; + int native_true = -1; + size_t native_size = sizeof(native_false); + CHECK(tcs_opt_get(socket_false, TCS_SOL_TCP, TCS_TCP_NODELAY, &native_false, &native_size) == TCS_SUCCESS); + native_size = sizeof(native_true); + CHECK(tcs_opt_get(socket_true, TCS_SOL_TCP, TCS_TCP_NODELAY, &native_true, &native_size) == TCS_SUCCESS); + CHECK(native_false == 0); + CHECK(native_true != 0); + + // Toggling back must clear it again + CHECK(tcs_opt_ip_no_delay_set(socket_true, false) == TCS_SUCCESS); + socket_true_value = true; + CHECK(tcs_opt_ip_no_delay_get(socket_true, &socket_true_value) == TCS_SUCCESS); + CHECK(socket_true_value == false); + native_true = -1; + native_size = sizeof(native_true); + CHECK(tcs_opt_get(socket_true, TCS_SOL_TCP, TCS_TCP_NODELAY, &native_true, &native_size) == TCS_SUCCESS); + CHECK(native_true == 0); + + // Clean up + CHECK(tcs_close(&socket_false) == TCS_SUCCESS); + CHECK(tcs_close(&socket_true) == TCS_SUCCESS); + REQUIRE(tcs_lib_cleanup() == TCS_SUCCESS); +} + TEST_CASE("Simple Multicast Add Membership") { // Setup From 067abed4454e8c0ba64675dc1270737c4f625c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Lindel=C3=B6w?= Date: Thu, 22 Oct 2026 11:50:20 +0200 Subject: [PATCH 2/3] Fix tcs_opt_ip_no_delay --- include/tinycsocket.h | 14 +++++++++----- src/tinycsocket_common.c | 4 ++-- src/tinycsocket_internal.h | 2 +- src/tinycsocket_posix.c | 4 +++- src/tinycsocket_win32.c | 4 +++- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/include/tinycsocket.h b/include/tinycsocket.h index cba21ba..2b95d4a 100644 --- a/include/tinycsocket.h +++ b/include/tinycsocket.h @@ -29,7 +29,7 @@ #ifndef TINYCSOCKET_INTERNAL_H_ #define TINYCSOCKET_INTERNAL_H_ -static const char* const TCS_VERSION_TXT = "v0.3.81"; +static const char* const TCS_VERSION_TXT = "v0.3.82"; extern const char* const TCS_LICENSE_TXT; /* @@ -2471,11 +2471,13 @@ const int32_t TCS_SO_PRIORITY = -1; #endif // IP options -const int32_t TCS_TCP_NODELAY = TCP_NODELAY; const int32_t TCS_IP_MEMBERSHIP_ADD = IP_ADD_MEMBERSHIP; const int32_t TCS_IP_MEMBERSHIP_DROP = IP_DROP_MEMBERSHIP; const int32_t TCS_IP_MULTICAST_LOOP = IP_MULTICAST_LOOP; +// TCP options +const int32_t TCS_TCP_NODELAY = TCP_NODELAY; + #if TCS_HAS_AF_PACKET const int32_t TCS_PACKET_MEMBERSHIP_ADD = PACKET_ADD_MEMBERSHIP; const int32_t TCS_PACKET_MEMBERSHIP_DROP = PACKET_DROP_MEMBERSHIP; @@ -4494,11 +4496,13 @@ const int32_t TCS_SO_OOBINLINE = SO_OOBINLINE; const int32_t TCS_SO_PRIORITY = -1; // IP options -const int32_t TCS_TCP_NODELAY = TCP_NODELAY; const int32_t TCS_IP_MEMBERSHIP_ADD = IP_ADD_MEMBERSHIP; const int32_t TCS_IP_MEMBERSHIP_DROP = IP_DROP_MEMBERSHIP; const int32_t TCS_IP_MULTICAST_LOOP = IP_MULTICAST_LOOP; +// TCP options +const int32_t TCS_TCP_NODELAY = TCP_NODELAY; + // ######## Internal Helpers ######## static TcsResult wsaerror2retcode(int wsa_error) @@ -6999,7 +7003,7 @@ TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay) return TCS_ERROR_INVALID_ARGUMENT; int b = use_no_delay ? 1 : 0; - return tcs_opt_set(socket, TCS_SOL_IP, TCS_TCP_NODELAY, &b, sizeof(b)); + return tcs_opt_set(socket, TCS_SOL_TCP, TCS_TCP_NODELAY, &b, sizeof(b)); } TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* is_no_delay_used) @@ -7008,7 +7012,7 @@ TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* is_no_delay_used) return TCS_ERROR_INVALID_ARGUMENT; int b = 0; size_t s = sizeof(b); - TcsResult sts = tcs_opt_get(socket, TCS_SOL_IP, TCS_TCP_NODELAY, &b, &s); + TcsResult sts = tcs_opt_get(socket, TCS_SOL_TCP, TCS_TCP_NODELAY, &b, &s); *is_no_delay_used = b; return sts; } diff --git a/src/tinycsocket_common.c b/src/tinycsocket_common.c index cf7c221..5606f1c 100644 --- a/src/tinycsocket_common.c +++ b/src/tinycsocket_common.c @@ -834,7 +834,7 @@ TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay) return TCS_ERROR_INVALID_ARGUMENT; int b = use_no_delay ? 1 : 0; - return tcs_opt_set(socket, TCS_SOL_IP, TCS_TCP_NODELAY, &b, sizeof(b)); + return tcs_opt_set(socket, TCS_SOL_TCP, TCS_TCP_NODELAY, &b, sizeof(b)); } TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* is_no_delay_used) @@ -843,7 +843,7 @@ TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* is_no_delay_used) return TCS_ERROR_INVALID_ARGUMENT; int b = 0; size_t s = sizeof(b); - TcsResult sts = tcs_opt_get(socket, TCS_SOL_IP, TCS_TCP_NODELAY, &b, &s); + TcsResult sts = tcs_opt_get(socket, TCS_SOL_TCP, TCS_TCP_NODELAY, &b, &s); *is_no_delay_used = b; return sts; } diff --git a/src/tinycsocket_internal.h b/src/tinycsocket_internal.h index 7fb339d..d9f7394 100644 --- a/src/tinycsocket_internal.h +++ b/src/tinycsocket_internal.h @@ -23,7 +23,7 @@ #ifndef TINYCSOCKET_INTERNAL_H_ #define TINYCSOCKET_INTERNAL_H_ -static const char* const TCS_VERSION_TXT = "v0.3.81"; +static const char* const TCS_VERSION_TXT = "v0.3.82"; extern const char* const TCS_LICENSE_TXT; /* diff --git a/src/tinycsocket_posix.c b/src/tinycsocket_posix.c index 628d892..b5085c8 100644 --- a/src/tinycsocket_posix.c +++ b/src/tinycsocket_posix.c @@ -173,11 +173,13 @@ const int32_t TCS_SO_PRIORITY = -1; #endif // IP options -const int32_t TCS_TCP_NODELAY = TCP_NODELAY; const int32_t TCS_IP_MEMBERSHIP_ADD = IP_ADD_MEMBERSHIP; const int32_t TCS_IP_MEMBERSHIP_DROP = IP_DROP_MEMBERSHIP; const int32_t TCS_IP_MULTICAST_LOOP = IP_MULTICAST_LOOP; +// TCP options +const int32_t TCS_TCP_NODELAY = TCP_NODELAY; + #if TCS_HAS_AF_PACKET const int32_t TCS_PACKET_MEMBERSHIP_ADD = PACKET_ADD_MEMBERSHIP; const int32_t TCS_PACKET_MEMBERSHIP_DROP = PACKET_DROP_MEMBERSHIP; diff --git a/src/tinycsocket_win32.c b/src/tinycsocket_win32.c index 55ad13e..34238a4 100644 --- a/src/tinycsocket_win32.c +++ b/src/tinycsocket_win32.c @@ -150,11 +150,13 @@ const int32_t TCS_SO_OOBINLINE = SO_OOBINLINE; const int32_t TCS_SO_PRIORITY = -1; // IP options -const int32_t TCS_TCP_NODELAY = TCP_NODELAY; const int32_t TCS_IP_MEMBERSHIP_ADD = IP_ADD_MEMBERSHIP; const int32_t TCS_IP_MEMBERSHIP_DROP = IP_DROP_MEMBERSHIP; const int32_t TCS_IP_MULTICAST_LOOP = IP_MULTICAST_LOOP; +// TCP options +const int32_t TCS_TCP_NODELAY = TCP_NODELAY; + // ######## Internal Helpers ######## static TcsResult wsaerror2retcode(int wsa_error) From 3df015b35100df56d661d788b21440fa7e9e7318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Lindel=C3=B6w?= Date: Thu, 22 Oct 2026 11:50:40 +0200 Subject: [PATCH 3/3] Rename tcs_opt_ip_no_delay to tcs_opt_tcp_no_delay --- include/tinycsocket.h | 20 ++++++++++---------- src/tinycsocket_common.c | 4 ++-- src/tinycsocket_internal.h | 8 ++++---- src/tinycsocket_posix.c | 4 ++-- src/tinycsocket_win32.c | 4 ++-- tests/tests.cpp | 18 +++++++++--------- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/tinycsocket.h b/include/tinycsocket.h index 2b95d4a..f661f2c 100644 --- a/include/tinycsocket.h +++ b/include/tinycsocket.h @@ -98,8 +98,8 @@ extern const char* const TCS_LICENSE_TXT; * - TcsResult tcs_opt_receive_timeout_get(TcsSocket socket, int* out_timeout_ms); * - TcsResult tcs_opt_linger_set(TcsSocket socket, bool do_linger, int timeout_seconds); * - TcsResult tcs_opt_linger_get(TcsSocket socket, bool* out_do_linger, int* out_timeout_seconds); -* - TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay); -* - TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); +* - TcsResult tcs_opt_tcp_no_delay_set(TcsSocket socket, bool use_no_delay); +* - TcsResult tcs_opt_tcp_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); * - TcsResult tcs_opt_out_of_band_inline_set(TcsSocket socket, bool enable_oob); * - TcsResult tcs_opt_out_of_band_inline_get(TcsSocket socket, bool* out_is_oob_enabled); * - TcsResult tcs_opt_priority_set(TcsSocket socket, int priority); @@ -1629,7 +1629,7 @@ TcsResult tcs_opt_linger_get(TcsSocket socket, bool* out_do_linger, int* out_tim * @param[in] use_no_delay set to true to disable Nagle's algorithm (lower latency), false to enable it. * @return #TCS_SUCCESS if successful, otherwise the error code. */ -TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay); +TcsResult tcs_opt_tcp_no_delay_set(TcsSocket socket, bool use_no_delay); /** * @brief Query whether Nagle's algorithm is disabled on a socket. @@ -1638,7 +1638,7 @@ TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay); * @param[out] out_is_no_delay_used pointer to receive the current setting. * @return #TCS_SUCCESS if successful, otherwise the error code. */ -TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); +TcsResult tcs_opt_tcp_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); /** * @brief Enable or disable inline reception of out-of-band data. @@ -3571,8 +3571,8 @@ TcsResult tcs_opt_linger_get(TcsSocket socket, bool* do_linger, int* timeout_sec return sts; } -// tcs_opt_ip_no_delay_set() is defined in tinycsocket_common.c -// tcs_opt_ip_no_delay_get() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_set() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_get() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_set() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_get() is defined in tinycsocket_common.c // tcs_opt_priority_set() is defined in tinycsocket_common.c @@ -5582,8 +5582,8 @@ TcsResult tcs_opt_linger_get(TcsSocket socket, bool* do_linger, int* timeout_sec return sts; } -// tcs_opt_ip_no_delay_set() is defined in tinycsocket_common.c -// tcs_opt_ip_no_delay_get() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_set() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_get() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_set() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_get() is defined in tinycsocket_common.c // tcs_opt_priority_set() is defined in tinycsocket_common.c @@ -6997,7 +6997,7 @@ TcsResult tcs_opt_receive_buffer_size_get(TcsSocket socket, size_t* receive_buff // tcs_opt_linger_set() is defined in OS specific files // tcs_opt_linger_get() is defined in OS specific files -TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay) +TcsResult tcs_opt_tcp_no_delay_set(TcsSocket socket, bool use_no_delay) { if (socket == TCS_SOCKET_INVALID) return TCS_ERROR_INVALID_ARGUMENT; @@ -7006,7 +7006,7 @@ TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay) return tcs_opt_set(socket, TCS_SOL_TCP, TCS_TCP_NODELAY, &b, sizeof(b)); } -TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* is_no_delay_used) +TcsResult tcs_opt_tcp_no_delay_get(TcsSocket socket, bool* is_no_delay_used) { if (socket == TCS_SOCKET_INVALID || is_no_delay_used == NULL) return TCS_ERROR_INVALID_ARGUMENT; diff --git a/src/tinycsocket_common.c b/src/tinycsocket_common.c index 5606f1c..fede4db 100644 --- a/src/tinycsocket_common.c +++ b/src/tinycsocket_common.c @@ -828,7 +828,7 @@ TcsResult tcs_opt_receive_buffer_size_get(TcsSocket socket, size_t* receive_buff // tcs_opt_linger_set() is defined in OS specific files // tcs_opt_linger_get() is defined in OS specific files -TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay) +TcsResult tcs_opt_tcp_no_delay_set(TcsSocket socket, bool use_no_delay) { if (socket == TCS_SOCKET_INVALID) return TCS_ERROR_INVALID_ARGUMENT; @@ -837,7 +837,7 @@ TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay) return tcs_opt_set(socket, TCS_SOL_TCP, TCS_TCP_NODELAY, &b, sizeof(b)); } -TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* is_no_delay_used) +TcsResult tcs_opt_tcp_no_delay_get(TcsSocket socket, bool* is_no_delay_used) { if (socket == TCS_SOCKET_INVALID || is_no_delay_used == NULL) return TCS_ERROR_INVALID_ARGUMENT; diff --git a/src/tinycsocket_internal.h b/src/tinycsocket_internal.h index d9f7394..6c904c0 100644 --- a/src/tinycsocket_internal.h +++ b/src/tinycsocket_internal.h @@ -92,8 +92,8 @@ extern const char* const TCS_LICENSE_TXT; * - TcsResult tcs_opt_receive_timeout_get(TcsSocket socket, int* out_timeout_ms); * - TcsResult tcs_opt_linger_set(TcsSocket socket, bool do_linger, int timeout_seconds); * - TcsResult tcs_opt_linger_get(TcsSocket socket, bool* out_do_linger, int* out_timeout_seconds); -* - TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay); -* - TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); +* - TcsResult tcs_opt_tcp_no_delay_set(TcsSocket socket, bool use_no_delay); +* - TcsResult tcs_opt_tcp_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); * - TcsResult tcs_opt_out_of_band_inline_set(TcsSocket socket, bool enable_oob); * - TcsResult tcs_opt_out_of_band_inline_get(TcsSocket socket, bool* out_is_oob_enabled); * - TcsResult tcs_opt_priority_set(TcsSocket socket, int priority); @@ -1623,7 +1623,7 @@ TcsResult tcs_opt_linger_get(TcsSocket socket, bool* out_do_linger, int* out_tim * @param[in] use_no_delay set to true to disable Nagle's algorithm (lower latency), false to enable it. * @return #TCS_SUCCESS if successful, otherwise the error code. */ -TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay); +TcsResult tcs_opt_tcp_no_delay_set(TcsSocket socket, bool use_no_delay); /** * @brief Query whether Nagle's algorithm is disabled on a socket. @@ -1632,7 +1632,7 @@ TcsResult tcs_opt_ip_no_delay_set(TcsSocket socket, bool use_no_delay); * @param[out] out_is_no_delay_used pointer to receive the current setting. * @return #TCS_SUCCESS if successful, otherwise the error code. */ -TcsResult tcs_opt_ip_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); +TcsResult tcs_opt_tcp_no_delay_get(TcsSocket socket, bool* out_is_no_delay_used); /** * @brief Enable or disable inline reception of out-of-band data. diff --git a/src/tinycsocket_posix.c b/src/tinycsocket_posix.c index b5085c8..857b467 100644 --- a/src/tinycsocket_posix.c +++ b/src/tinycsocket_posix.c @@ -1273,8 +1273,8 @@ TcsResult tcs_opt_linger_get(TcsSocket socket, bool* do_linger, int* timeout_sec return sts; } -// tcs_opt_ip_no_delay_set() is defined in tinycsocket_common.c -// tcs_opt_ip_no_delay_get() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_set() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_get() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_set() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_get() is defined in tinycsocket_common.c // tcs_opt_priority_set() is defined in tinycsocket_common.c diff --git a/src/tinycsocket_win32.c b/src/tinycsocket_win32.c index 34238a4..ffbf633 100644 --- a/src/tinycsocket_win32.c +++ b/src/tinycsocket_win32.c @@ -1236,8 +1236,8 @@ TcsResult tcs_opt_linger_get(TcsSocket socket, bool* do_linger, int* timeout_sec return sts; } -// tcs_opt_ip_no_delay_set() is defined in tinycsocket_common.c -// tcs_opt_ip_no_delay_get() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_set() is defined in tinycsocket_common.c +// tcs_opt_tcp_no_delay_get() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_set() is defined in tinycsocket_common.c // tcs_opt_out_of_band_inline_get() is defined in tinycsocket_common.c // tcs_opt_priority_set() is defined in tinycsocket_common.c diff --git a/tests/tests.cpp b/tests/tests.cpp index 169aa3e..41087aa 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -1556,18 +1556,18 @@ TEST_CASE("TCS_TCP_NODELAY") CHECK(tcs_socket(&socket_true, TCS_FAMILY_IPV4, TCS_SOCKET_STREAM, TCS_PROTOCOL_IP_TCP) == TCS_SUCCESS); // When - CHECK(tcs_opt_ip_no_delay_set(socket_false, false) == TCS_SUCCESS); - CHECK(tcs_opt_ip_no_delay_set(socket_true, true) == TCS_SUCCESS); - CHECK(tcs_opt_ip_no_delay_set(socket_null, true) == TCS_ERROR_INVALID_ARGUMENT); + CHECK(tcs_opt_tcp_no_delay_set(socket_false, false) == TCS_SUCCESS); + CHECK(tcs_opt_tcp_no_delay_set(socket_true, true) == TCS_SUCCESS); + CHECK(tcs_opt_tcp_no_delay_set(socket_null, true) == TCS_ERROR_INVALID_ARGUMENT); // Then bool socket_false_value = true; bool socket_true_value = false; bool socket_null_value = false; - CHECK(tcs_opt_ip_no_delay_get(socket_false, &socket_false_value) == TCS_SUCCESS); - CHECK(tcs_opt_ip_no_delay_get(socket_true, &socket_true_value) == TCS_SUCCESS); - CHECK(tcs_opt_ip_no_delay_get(socket_null, &socket_null_value) == TCS_ERROR_INVALID_ARGUMENT); - CHECK(tcs_opt_ip_no_delay_get(socket_true, NULL) == TCS_ERROR_INVALID_ARGUMENT); + CHECK(tcs_opt_tcp_no_delay_get(socket_false, &socket_false_value) == TCS_SUCCESS); + CHECK(tcs_opt_tcp_no_delay_get(socket_true, &socket_true_value) == TCS_SUCCESS); + CHECK(tcs_opt_tcp_no_delay_get(socket_null, &socket_null_value) == TCS_ERROR_INVALID_ARGUMENT); + CHECK(tcs_opt_tcp_no_delay_get(socket_true, NULL) == TCS_ERROR_INVALID_ARGUMENT); CHECK(socket_false_value == false); CHECK(socket_true_value == true); @@ -1583,9 +1583,9 @@ TEST_CASE("TCS_TCP_NODELAY") CHECK(native_true != 0); // Toggling back must clear it again - CHECK(tcs_opt_ip_no_delay_set(socket_true, false) == TCS_SUCCESS); + CHECK(tcs_opt_tcp_no_delay_set(socket_true, false) == TCS_SUCCESS); socket_true_value = true; - CHECK(tcs_opt_ip_no_delay_get(socket_true, &socket_true_value) == TCS_SUCCESS); + CHECK(tcs_opt_tcp_no_delay_get(socket_true, &socket_true_value) == TCS_SUCCESS); CHECK(socket_true_value == false); native_true = -1; native_size = sizeof(native_true);