aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/ws/ws_test.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-10-26 10:54:58 -0700
committerGarrett D'Amore <garrett@damore.org>2025-10-27 07:13:40 -0700
commitbe13c2e8845423cec17af429fc4e16a5d9749e47 (patch)
tree82614e403a41aac6581a9a223ef9eba5be557222 /src/sp/transport/ws/ws_test.c
parent11c53f3d7f747d14fd69ce98c63d629bc821ef68 (diff)
downloadnng-be13c2e8845423cec17af429fc4e16a5d9749e47.tar.gz
nng-be13c2e8845423cec17af429fc4e16a5d9749e47.tar.bz2
nng-be13c2e8845423cec17af429fc4e16a5d9749e47.zip
Replace nng_pipe_get_addr, nng_stream_get_addr, and the NNG_OPT_REMADDR option.
More direct access methods are provided instead. This results in much lower friction when using, and is a step on the path to removing NNG_OPT_LOCADDR as well. We need to figure a solution for NNG_OPT_LOCADDR for dialers; for listeners there is little use in it either, and it will be removed. (Dialers will probably get a new NNG_OPT_BIND_IP option.)
Diffstat (limited to 'src/sp/transport/ws/ws_test.c')
-rw-r--r--src/sp/transport/ws/ws_test.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/sp/transport/ws/ws_test.c b/src/sp/transport/ws/ws_test.c
index 6f41fe99..c69e5845 100644
--- a/src/sp/transport/ws/ws_test.c
+++ b/src/sp/transport/ws/ws_test.c
@@ -205,25 +205,22 @@ static void
check_props_v4(nng_msg *msg)
{
nng_pipe p;
- size_t z;
nng_sockaddr la;
nng_sockaddr ra;
bool b;
p = nng_msg_get_pipe(msg);
NUTS_TRUE(nng_pipe_id(p) > 0);
- NUTS_PASS(nng_pipe_get_addr(p, NNG_OPT_LOCADDR, &la));
- NUTS_FAIL(nng_pipe_get_size(p, NNG_OPT_LOCADDR, &z), NNG_EBADTYPE);
+ NUTS_PASS(nng_pipe_self_addr(p, &la));
NUTS_TRUE(la.s_family == NNG_AF_INET);
NUTS_TRUE(la.s_in.sa_port != 0);
NUTS_TRUE(la.s_in.sa_addr == nuts_be32(0x7f000001));
- NUTS_PASS(nng_pipe_get_addr(p, NNG_OPT_REMADDR, &ra));
+ NUTS_PASS(nng_pipe_peer_addr(p, &ra));
NUTS_TRUE(ra.s_family == NNG_AF_INET);
NUTS_TRUE(ra.s_in.sa_port != 0);
NUTS_TRUE(ra.s_in.sa_addr == nuts_be32(0x7f000001));
NUTS_TRUE(ra.s_in.sa_port != la.s_in.sa_port);
- NUTS_FAIL(nng_pipe_get_size(p, NNG_OPT_REMADDR, &z), NNG_EBADTYPE);
NUTS_PASS(nng_pipe_get_bool(p, NNG_OPT_TCP_KEEPALIVE, &b));
NUTS_TRUE(b == false); // default