diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-02 23:16:22 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-02 23:16:22 -0700 |
| commit | 8bac5ccdf1de7334311459b9e2666e74a2c16c15 (patch) | |
| tree | 169ce8229a1a0eb6e810685a9923be1c2bf644a6 /src/core | |
| parent | d3622c0f6153ce0eccaad9c986d46b07cec91b5d (diff) | |
| download | nng-8bac5ccdf1de7334311459b9e2666e74a2c16c15.tar.gz nng-8bac5ccdf1de7334311459b9e2666e74a2c16c15.tar.bz2 nng-8bac5ccdf1de7334311459b9e2666e74a2c16c15.zip | |
Replace `NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, and friends with functions.
Socket options were a little awkward, and these are core properties
of the socket. Few if any applications need these. This also avoids
some dynamic allocations.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/socket.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 9376f9de..0e9b6b17 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -227,30 +227,6 @@ sock_set_sockname(void *s, const void *buf, size_t sz, nni_type t) return (rv); } -static int -sock_get_proto(void *s, void *buf, size_t *szp, nni_type t) -{ - return (nni_copyout_int(nni_sock_proto_id(SOCK(s)), buf, szp, t)); -} - -static int -sock_get_peer(void *s, void *buf, size_t *szp, nni_type t) -{ - return (nni_copyout_int(nni_sock_peer_id(SOCK(s)), buf, szp, t)); -} - -static int -sock_get_protoname(void *s, void *buf, size_t *szp, nni_type t) -{ - return (nni_copyout_str(nni_sock_proto_name(SOCK(s)), buf, szp, t)); -} - -static int -sock_get_peername(void *s, void *buf, size_t *szp, nni_type t) -{ - return (nni_copyout_str(nni_sock_peer_name(SOCK(s)), buf, szp, t)); -} - static const nni_option sock_options[] = { { .o_name = NNG_OPT_RECVTIMEO, @@ -281,22 +257,6 @@ static const nni_option sock_options[] = { .o_name = NNG_OPT_RAW, .o_get = sock_get_raw, }, - { - .o_name = NNG_OPT_PROTO, - .o_get = sock_get_proto, - }, - { - .o_name = NNG_OPT_PEER, - .o_get = sock_get_peer, - }, - { - .o_name = NNG_OPT_PROTONAME, - .o_get = sock_get_protoname, - }, - { - .o_name = NNG_OPT_PEERNAME, - .o_get = sock_get_peername, - }, // terminate list { .o_name = NULL, |
