From be13c2e8845423cec17af429fc4e16a5d9749e47 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 26 Oct 2025 10:54:58 -0700 Subject: 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.) --- src/platform/ipc_stream_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/platform/ipc_stream_test.c') diff --git a/src/platform/ipc_stream_test.c b/src/platform/ipc_stream_test.c index fb3bc493..45c78d23 100644 --- a/src/platform/ipc_stream_test.c +++ b/src/platform/ipc_stream_test.c @@ -29,9 +29,9 @@ test_ipc_stream(void) nng_aio *aio1; nng_aio *aio2; nng_iov iov; - nng_sockaddr sa2; char buf1[5]; char buf2[5]; + const nng_sockaddr *sap; NUTS_ADDR(url, "ipc"); NUTS_PASS(nng_aio_alloc(&daio, NULL, NULL)); @@ -85,9 +85,9 @@ test_ipc_stream(void) NUTS_TRUE(memcmp(buf1, buf2, 5) == 0); - NUTS_PASS(nng_stream_get_addr(c2, NNG_OPT_LOCADDR, &sa2)); - NUTS_TRUE(sa2.s_ipc.sa_family == NNG_AF_IPC); - NUTS_MATCH(sa2.s_ipc.sa_path, url + strlen("ipc://")); + sap = nng_stream_self_addr(c2); + NUTS_TRUE(sap->s_ipc.sa_family == NNG_AF_IPC); + NUTS_MATCH(sap->s_ipc.sa_path, url + strlen("ipc://")); nng_aio_free(aio1); nng_aio_free(aio2); -- cgit v1.2.3-70-g09d2