NNG_PUB(7)
β¨ NNG_PUB(7) β the pub protocol, bestie edition β¨
okay so this is nng_pub, straight out of the NNG Reference Manual π
(yes the manual page is literally called NNG_PUB(7), we're fancy like that)
π NAME π
nng_pub β the publisher protocol, aka the one who does all the talking π’
πΈ SYNOPSIS πΈ
#include <nng/protocol/pubsub0/pub.h>
that's it, that's the whole vibe. go forth and publish π
π¦ DESCRIPTION π¦
so pub is literally one half of the publisher/subscriber pattern β a dynamic duo, main character energy fr fr π
in this pattern, a publisher sends data, which gets broadcast to all subscribers. meanwhile the subscribing apps only see the data they actually subscribed to. so they're getting the filtered feed, not the firehose, periodt β¨
the pub protocol is the publisher side, and the sub protocol is the subscriber side. two halves of one iconic whole π«Ά
Note π In this implementation, the publisher delivers all messages to all subscribers. The subscribers maintain their own subscriptions, and filter them locally. Thus, this pattern should not be used in an attempt to reduce bandwidth consumption. not me exposing that we broadcast everything anyway π it's giving "everyone gets the text, you just choose whether to read it" π
the topics that subscribers subscribe to is just the first part of the message body. so like, applications should construct their messages accordingly β build them with that in mind, bestie π§
π₯ Socket Operations π₯
the nng_pub0_open() function(s) create a publisher socket. this socket may be used to send messages, but it is unable to receive them. and if you try to receive anyway? you get NNG_ENOTSUP π it literally cannot and will not, sorry babe
β Protocol Versions β
only version 0 of this protocol is supported. (at the time of writing, no other versions of this protocol have been defined.) so v0 or nothing, iykyk π
π Protocol Options π
the pub protocol has no protocol-specific options. zero. none. clean slate, no notes π
π Protocol Headers π
the pub protocol has no protocol-specific headers. also none. the bare-faced, no-makeup look of protocols honestly π¦
π SEE ALSO π
and that's the whole page, bestie!! mwah π this one's from the NNG Reference Manual, dated 2026-06-30 β go slay some messages β¨π
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms