diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-10-26 10:54:58 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-10-27 07:13:40 -0700 |
| commit | be13c2e8845423cec17af429fc4e16a5d9749e47 (patch) | |
| tree | 82614e403a41aac6581a9a223ef9eba5be557222 /src/sp/transport/udp/udp.c | |
| parent | 11c53f3d7f747d14fd69ce98c63d629bc821ef68 (diff) | |
| download | nng-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/udp/udp.c')
| -rw-r--r-- | src/sp/transport/udp/udp.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/sp/transport/udp/udp.c b/src/sp/transport/udp/udp.c index 02eb088a..016c222b 100644 --- a/src/sp/transport/udp/udp.c +++ b/src/sp/transport/udp/udp.c @@ -993,28 +993,12 @@ udp_pipe_get_recvmax(void *arg, void *v, size_t *szp, nni_type t) return (rv); } -static nng_err -udp_pipe_get_remaddr(void *arg, void *v, size_t *szp, nni_type t) -{ - udp_pipe *p = arg; - udp_ep *ep = p->ep; - nng_err rv; - nni_mtx_lock(&ep->mtx); - rv = nni_copyout_sockaddr(&p->peer_addr, v, szp, t); - nni_mtx_unlock(&ep->mtx); - return (rv); -} - static nni_option udp_pipe_options[] = { { .o_name = NNG_OPT_RECVMAXSZ, .o_get = udp_pipe_get_recvmax, }, { - .o_name = NNG_OPT_REMADDR, - .o_get = udp_pipe_get_remaddr, - }, - { .o_name = NULL, }, }; @@ -1547,22 +1531,6 @@ udp_ep_get_locaddr(void *arg, void *v, size_t *szp, nni_opt_type t) } static nng_err -udp_ep_get_remaddr(void *arg, void *v, size_t *szp, nni_opt_type t) -{ - udp_ep *ep = arg; - nng_err rv; - nng_sockaddr sa; - - if (!ep->dialer) { - return (NNG_ENOTSUP); - } - sa = ep->peer_sa; - - rv = nni_copyout_sockaddr(&sa, v, szp, t); - return (rv); -} - -static nng_err udp_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) { udp_ep *ep = arg; @@ -1736,10 +1704,6 @@ static const nni_option udp_ep_opts[] = { .o_get = udp_ep_get_locaddr, }, { - .o_name = NNG_OPT_REMADDR, - .o_get = udp_ep_get_remaddr, - }, - { .o_name = NNG_OPT_BOUND_PORT, .o_get = udp_ep_get_port, }, |
