aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/pubsub0/pub_test.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-02 13:57:53 -0700
committerGarrett D'Amore <garrett@damore.org>2024-11-02 14:47:50 -0700
commit279180c1d07fc2c4c0bfa8f5a418cb02c4b87863 (patch)
treeb451ac7f845062674d6ab45eb5d530628d3ff47c /src/sp/protocol/pubsub0/pub_test.c
parent9b27984d0e2da430b78a975e59f55c96de5f6056 (diff)
downloadnng-279180c1d07fc2c4c0bfa8f5a418cb02c4b87863.tar.gz
nng-279180c1d07fc2c4c0bfa8f5a418cb02c4b87863.tar.bz2
nng-279180c1d07fc2c4c0bfa8f5a418cb02c4b87863.zip
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.
Diffstat (limited to 'src/sp/protocol/pubsub0/pub_test.c')
-rw-r--r--src/sp/protocol/pubsub0/pub_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sp/protocol/pubsub0/pub_test.c b/src/sp/protocol/pubsub0/pub_test.c
index 462decd2..4be4b06f 100644
--- a/src/sp/protocol/pubsub0/pub_test.c
+++ b/src/sp/protocol/pubsub0/pub_test.c
@@ -7,6 +7,7 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include "nng/nng.h"
#include <nuts.h>
static void
@@ -58,7 +59,7 @@ test_pub_not_readable(void)
nng_socket pub;
NUTS_PASS(nng_pub0_open(&pub));
- NUTS_FAIL(nng_socket_get_int(pub, NNG_OPT_RECVFD, &fd), NNG_ENOTSUP);
+ NUTS_FAIL(nng_socket_get_recv_poll_fd(pub, &fd), NNG_ENOTSUP);
NUTS_CLOSE(pub);
}
@@ -71,7 +72,7 @@ test_pub_poll_writeable(void)
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_pub0_open(&pub));
- NUTS_PASS(nng_socket_get_int(pub, NNG_OPT_SENDFD, &fd));
+ NUTS_PASS(nng_socket_get_send_poll_fd(pub, &fd));
NUTS_TRUE(fd >= 0);
// Pub is *always* writeable