diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-09 09:25:22 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-11 10:31:44 -0800 |
| commit | 3163a56e06a58abb10c753fc77da388234d580c2 (patch) | |
| tree | a35a02af1590d94cedb5fbcaef7de535d8e5b73e /src/core/socket.c | |
| parent | 18d7519234f456a487623d93bcb6daa121d0ce17 (diff) | |
| download | nng-3163a56e06a58abb10c753fc77da388234d580c2.tar.gz nng-3163a56e06a58abb10c753fc77da388234d580c2.tar.bz2 nng-3163a56e06a58abb10c753fc77da388234d580c2.zip | |
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.
Diffstat (limited to 'src/core/socket.c')
| -rw-r--r-- | src/core/socket.c | 18 |
1 files changed, 18 insertions, 0 deletions
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) { |
