aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-11-10 05:47:37 -0800
committerGarrett D'Amore <garrett@damore.org>2019-11-10 05:47:37 -0800
commit21b40e0b51c39a19574c1fe79a48872558189770 (patch)
tree57c9129a26e8feab8d0db6541ee6dc764934a2fd /docs
parent20065fd19ecec1feadf8ba6c36724da6ac62d21d (diff)
downloadnng-21b40e0b51c39a19574c1fe79a48872558189770.tar.gz
nng-21b40e0b51c39a19574c1fe79a48872558189770.tar.bz2
nng-21b40e0b51c39a19574c1fe79a48872558189770.zip
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.
Diffstat (limited to 'docs')
-rw-r--r--docs/man/nng_sub.7.adoc7
1 files changed, 7 insertions, 0 deletions
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`))::