From 3163a56e06a58abb10c753fc77da388234d580c2 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 9 Nov 2024 09:25:22 -0800 Subject: Add nng_sub0_subscribe and friends. These are new functions that replace `NNG_OPT_SUBSCRIBE` and `NNG_OPT_UNSUBSCRIBE`. They are provided here as a transition aid before those options are removed in NNG 2.0. --- src/core/socket.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index bf550a24..241b0401 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -889,12 +889,30 @@ nni_sock_proto_pipe_ops(nni_sock *sock) return (&sock->s_pipe_ops); } +struct nni_proto_sock_ops * +nni_sock_proto_ops(nni_sock *sock) +{ + return (&sock->s_sock_ops); +} + +struct nni_proto_ctx_ops * +nni_ctx_proto_ops(nni_ctx *ctx) +{ + return (&ctx->c_ops); +} + void * nni_sock_proto_data(nni_sock *sock) { return (sock->s_data); } +void * +nni_ctx_proto_data(nni_ctx *ctx) +{ + return (ctx->c_data); +} + int nni_sock_add_listener(nni_sock *s, nni_listener *l) { -- cgit v1.2.3-70-g09d2