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/windows/win_ipcdial.c | 12 ------------ src/platform/windows/win_ipclisten.c | 11 ----------- src/platform/windows/win_tcplisten.c | 4 ---- 3 files changed, 27 deletions(-) (limited to 'src/platform/windows') diff --git a/src/platform/windows/win_ipcdial.c b/src/platform/windows/win_ipcdial.c index 04ee5829..c9aabfe4 100644 --- a/src/platform/windows/win_ipcdial.c +++ b/src/platform/windows/win_ipcdial.c @@ -205,19 +205,7 @@ ipc_dialer_free(void *arg) NNI_FREE_STRUCT(d); } -static nng_err -ipc_dialer_get_remaddr(void *arg, void *buf, size_t *szp, nni_type t) -{ - ipc_dialer *d = arg; - - return (nni_copyout_sockaddr(&d->sa, buf, szp, t)); -} - static const nni_option ipc_dialer_options[] = { - { - .o_name = NNG_OPT_REMADDR, - .o_get = ipc_dialer_get_remaddr, - }, { .o_name = NULL, }, diff --git a/src/platform/windows/win_ipclisten.c b/src/platform/windows/win_ipclisten.c index 07c69507..26c5573e 100644 --- a/src/platform/windows/win_ipclisten.c +++ b/src/platform/windows/win_ipclisten.c @@ -158,18 +158,7 @@ ipc_listener_set_sec_desc(void *arg, void *desc) return (NNG_OK); } -static nng_err -ipc_listener_get_addr(void *arg, void *buf, size_t *szp, nni_type t) -{ - ipc_listener *l = arg; - return ((nni_copyout_sockaddr(&l->sa, buf, szp, t))); -} - static const nni_option ipc_listener_options[] = { - { - .o_name = NNG_OPT_LOCADDR, - .o_get = ipc_listener_get_addr, - }, { .o_name = NULL, }, diff --git a/src/platform/windows/win_tcplisten.c b/src/platform/windows/win_tcplisten.c index b32c1fbb..a0d7a249 100644 --- a/src/platform/windows/win_tcplisten.c +++ b/src/platform/windows/win_tcplisten.c @@ -502,10 +502,6 @@ tcp_listener_get_listen_fd(void *arg, void *buf, size_t *szp, nni_type t) #endif static const nni_option tcp_listener_options[] = { - { - .o_name = NNG_OPT_LOCADDR, - .o_get = tcp_listener_get_locaddr, - }, { .o_name = NNG_OPT_TCP_NODELAY, .o_set = tcp_listener_set_nodelay, -- cgit v1.2.3-70-g09d2