diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-02 13:57:53 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-02 14:47:50 -0700 |
| commit | 279180c1d07fc2c4c0bfa8f5a418cb02c4b87863 (patch) | |
| tree | b451ac7f845062674d6ab45eb5d530628d3ff47c /src/sp/protocol/pair0/pair0_test.c | |
| parent | 9b27984d0e2da430b78a975e59f55c96de5f6056 (diff) | |
| download | nng-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/pair0/pair0_test.c')
| -rw-r--r-- | src/sp/protocol/pair0/pair0_test.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sp/protocol/pair0/pair0_test.c b/src/sp/protocol/pair0/pair0_test.c index 83d72c0c..e2196479 100644 --- a/src/sp/protocol/pair0/pair0_test.c +++ b/src/sp/protocol/pair0/pair0_test.c @@ -1,5 +1,5 @@ // -// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2017 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -8,6 +8,7 @@ // found online at https://opensource.org/licenses/MIT. // +#include "nng/nng.h" #include <nuts.h> #define SECOND 1000 @@ -340,7 +341,7 @@ test_pair0_poll_readable(void) NUTS_PASS(nng_pair0_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! @@ -386,7 +387,7 @@ test_pair0_poll_writable(void) NUTS_PASS(nng_pair0_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_SENDFD, &fd)); + NUTS_PASS(nng_socket_get_send_poll_fd(s1, &fd)); NUTS_TRUE(fd >= 0); // Not writable if not connected! |
