diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-03 00:51:15 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-03 00:58:37 -0700 |
| commit | b3fc8a44119d7ab90366a1b92a5e1327ebcb8145 (patch) | |
| tree | 994c0199184fdea3d56eeb61b252e10733588947 /include | |
| parent | 02ec0b55cbee5de4d0fd688ce0ebddf08178dc98 (diff) | |
| download | nng-b3fc8a44119d7ab90366a1b92a5e1327ebcb8145.tar.gz nng-b3fc8a44119d7ab90366a1b92a5e1327ebcb8145.tar.bz2 nng-b3fc8a44119d7ab90366a1b92a5e1327ebcb8145.zip | |
Replace NNG_OPT_SUB_SUBSCRIBE/UNSUBSCRIBE with functions.
The main purpose is to eliminate the NNI_TYPE_OPAQUE options,
by putting these into their own first class, protocol-specific, functions.
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/protocol/pubsub0/sub.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/nng/protocol/pubsub0/sub.h b/include/nng/protocol/pubsub0/sub.h index 81f50a80..a8a37823 100644 --- a/include/nng/protocol/pubsub0/sub.h +++ b/include/nng/protocol/pubsub0/sub.h @@ -11,6 +11,8 @@ #ifndef NNG_PROTOCOL_PUBSUB0_SUB_H #define NNG_PROTOCOL_PUBSUB0_SUB_H +#include <nng/nng.h> + #ifdef __cplusplus extern "C" { #endif @@ -19,6 +21,13 @@ NNG_DECL int nng_sub0_open(nng_socket *); NNG_DECL int nng_sub0_open_raw(nng_socket *); +NNG_DECL int nng_sub0_socket_subscribe( + nng_socket id, const void *buf, size_t sz); +NNG_DECL int nng_sub0_socket_unsubscribe( + nng_socket id, const void *buf, size_t sz); +NNG_DECL int nng_sub0_ctx_subscribe(nng_ctx id, const void *buf, size_t sz); +NNG_DECL int nng_sub0_ctx_unsubscribe(nng_ctx id, const void *buf, size_t sz); + #ifndef nng_sub_open #define nng_sub_open nng_sub0_open #endif @@ -27,9 +36,6 @@ NNG_DECL int nng_sub0_open_raw(nng_socket *); #define nng_sub_open_raw nng_sub0_open_raw #endif -#define NNG_OPT_SUB_SUBSCRIBE "sub:subscribe" -#define NNG_OPT_SUB_UNSUBSCRIBE "sub:unsubscribe" - #define NNG_OPT_SUB_PREFNEW "sub:prefnew" #ifdef __cplusplus |
