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/reqrep0/rep_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/reqrep0/rep_test.c')
| -rw-r--r-- | src/sp/protocol/reqrep0/rep_test.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/sp/protocol/reqrep0/rep_test.c b/src/sp/protocol/reqrep0/rep_test.c index 1a535998..58a54afe 100644 --- a/src/sp/protocol/reqrep0/rep_test.c +++ b/src/sp/protocol/reqrep0/rep_test.c @@ -54,7 +54,7 @@ test_rep_poll_writeable(void) NUTS_PASS(nng_req0_open(&req)); NUTS_PASS(nng_rep0_open(&rep)); - NUTS_PASS(nng_socket_get_int(rep, NNG_OPT_SENDFD, &fd)); + NUTS_PASS(nng_socket_get_send_poll_fd(rep, &fd)); NUTS_TRUE(fd >= 0); // Not writable before connect. @@ -91,7 +91,7 @@ test_rep_poll_readable(void) NUTS_PASS(nng_req0_open(&req)); NUTS_PASS(nng_rep0_open(&rep)); - NUTS_PASS(nng_socket_get_int(rep, NNG_OPT_RECVFD, &fd)); + NUTS_PASS(nng_socket_get_recv_poll_fd(rep, &fd)); NUTS_TRUE(fd >= 0); // Not readable if not connected! @@ -120,21 +120,6 @@ test_rep_poll_readable(void) } void -test_rep_context_no_poll(void) -{ - int fd; - nng_socket req; - nng_ctx ctx; - - NUTS_PASS(nng_rep0_open(&req)); - NUTS_PASS(nng_ctx_open(&ctx, req)); - NUTS_FAIL(nng_ctx_get_int(ctx, NNG_OPT_SENDFD, &fd), NNG_ENOTSUP); - NUTS_FAIL(nng_ctx_get_int(ctx, NNG_OPT_RECVFD, &fd), NNG_ENOTSUP); - NUTS_PASS(nng_ctx_close(ctx)); - NUTS_CLOSE(req); -} - -void test_rep_validate_peer(void) { nng_socket s1, s2; @@ -763,7 +748,6 @@ NUTS_TESTS = { { "rep send bad state", test_rep_send_bad_state }, { "rep poll readable", test_rep_poll_readable }, { "rep poll writable", test_rep_poll_writeable }, - { "rep context does not poll", test_rep_context_no_poll }, { "rep validate peer", test_rep_validate_peer }, { "rep huge send", test_rep_huge_send }, { "rep huge send socket", test_rep_huge_send_socket }, |
