aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/pipeline0/push_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/pipeline0/push_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/pipeline0/push_test.c')
-rw-r--r--src/sp/protocol/pipeline0/push_test.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sp/protocol/pipeline0/push_test.c b/src/sp/protocol/pipeline0/push_test.c
index 15574732..249c62a9 100644
--- a/src/sp/protocol/pipeline0/push_test.c
+++ b/src/sp/protocol/pipeline0/push_test.c
@@ -7,6 +7,7 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include "nng/nng.h"
#include <nuts.h>
static void
@@ -59,7 +60,7 @@ test_push_not_readable(void)
nng_socket s;
NUTS_PASS(nng_push0_open(&s));
- NUTS_FAIL(nng_socket_get_int(s, NNG_OPT_RECVFD, &fd), NNG_ENOTSUP);
+ NUTS_FAIL(nng_socket_get_recv_poll_fd(s, &fd), NNG_ENOTSUP);
NUTS_CLOSE(s);
}
@@ -74,7 +75,7 @@ test_push_poll_writable(void)
NUTS_PASS(nng_push0_open(&push));
NUTS_PASS(nng_socket_set_ms(pull, NNG_OPT_RECVTIMEO, 1000));
NUTS_PASS(nng_socket_set_ms(push, NNG_OPT_SENDTIMEO, 1000));
- NUTS_PASS(nng_socket_get_int(push, NNG_OPT_SENDFD, &fd));
+ NUTS_PASS(nng_socket_get_send_poll_fd(push, &fd));
NUTS_TRUE(fd >= 0);
// This tests unbuffered sockets for now.
@@ -118,7 +119,7 @@ test_push_poll_buffered(void)
NUTS_PASS(nng_socket_set_ms(pull, NNG_OPT_RECVTIMEO, 1000));
NUTS_PASS(nng_socket_set_ms(push, NNG_OPT_SENDTIMEO, 1000));
NUTS_PASS(nng_socket_set_int(push, NNG_OPT_SENDBUF, 2));
- NUTS_PASS(nng_socket_get_int(push, NNG_OPT_SENDFD, &fd));
+ NUTS_PASS(nng_socket_get_send_poll_fd(push, &fd));
NUTS_TRUE(fd >= 0);
// We can write two message while unbuffered.
@@ -168,7 +169,7 @@ test_push_poll_truncate(void)
NUTS_PASS(nng_socket_set_ms(pull, NNG_OPT_RECVTIMEO, 1000));
NUTS_PASS(nng_socket_set_ms(push, NNG_OPT_SENDTIMEO, 1000));
NUTS_PASS(nng_socket_set_int(push, NNG_OPT_SENDBUF, 3));
- NUTS_PASS(nng_socket_get_int(push, NNG_OPT_SENDFD, &fd));
+ NUTS_PASS(nng_socket_get_send_poll_fd(push, &fd));
NUTS_TRUE(fd >= 0);
// We can write two message while unbuffered.