From 21b40e0b51c39a19574c1fe79a48872558189770 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 10 Nov 2019 05:47:37 -0800 Subject: fixes #999 NNG_OPT_SUB_SUBSCRIBE: nng_setopt vs nng_setopt_string This is just a documentation clarification around the hazard of using nng_setopt_string with NNG_OPT_SUBSCRIBE. --- docs/man/nng_sub.7.adoc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/man/nng_sub.7.adoc b/docs/man/nng_sub.7.adoc index aef1a9e4..2d0e6de1 100644 --- a/docs/man/nng_sub.7.adoc +++ b/docs/man/nng_sub.7.adoc @@ -65,6 +65,13 @@ The following protocol-specific options are available. message is accepted. If no topic matches, then the message is discarded. + +NOTE: This option is a byte array. Thus if you use +xref:nng_setopt.3.adoc[`nng_setopt_string()`] the `NUL` terminator byte will +be included in the topic. +If that isn't desired, consider using +xref:nng_setopt.3.adoc[`nng_setopt()`] and using `strlen()` of the topic +as the topic size. ++ TIP: To receive all messages, an empty topic (zero length) can be used. ((`NNG_OPT_SUB_UNSUBSCRIBE`)):: -- cgit v1.2.3-70-g09d2