From 279180c1d07fc2c4c0bfa8f5a418cb02c4b87863 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 2 Nov 2024 13:57:53 -0700 Subject: NNG_OPT_RECVFD and NNG_OPT_SENDFD converted to functions. These options are removed entirely, and their functionality is now available via special functions, `nng_socket_get_send_poll_fd` and `nng_socket_get_recv_poll_fd`, making these first class methods on the socket. This eliminates a bit of wasteful code, and provides type safety for these methods. --- src/sp/protocol/bus0/bus_test.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/sp/protocol/bus0/bus_test.c') diff --git a/src/sp/protocol/bus0/bus_test.c b/src/sp/protocol/bus0/bus_test.c index a832d9dd..7e049e34 100644 --- a/src/sp/protocol/bus0/bus_test.c +++ b/src/sp/protocol/bus0/bus_test.c @@ -7,6 +7,7 @@ // found online at https://opensource.org/licenses/MIT. // +#include "nng/nng.h" #include #include @@ -244,7 +245,7 @@ test_bus_poll_readable(void) NUTS_PASS(nng_bus0_open(&s2)); NUTS_PASS(nng_socket_set_ms(s1, NNG_OPT_RECVTIMEO, 1000)); NUTS_PASS(nng_socket_set_ms(s2, NNG_OPT_SENDTIMEO, 1000)); - NUTS_PASS(nng_socket_get_int(s1, NNG_OPT_RECVFD, &fd)); + NUTS_PASS(nng_socket_get_recv_poll_fd(s1, &fd)); NUTS_TRUE(fd >= 0); // Not readable if not connected! @@ -277,10 +278,10 @@ test_bus_poll_writeable(void) NUTS_PASS(nng_bus0_open(&s1)); NUTS_PASS(nng_bus0_open(&s2)); NUTS_PASS(nng_socket_set_int(s2, NNG_OPT_SENDBUF, 1)); - NUTS_PASS(nng_socket_get_int(s2, NNG_OPT_SENDFD, &fd)); + NUTS_PASS(nng_socket_get_send_poll_fd(s2, &fd)); NUTS_TRUE(fd >= 0); - // Pub is *always* writeable + // Bus is *always* writeable NUTS_TRUE(nuts_poll_fd(fd)); // Even after connect (no message yet) -- cgit v1.2.3-70-g09d2