NNG_SUB_OPEN(3)
β¨ NNG_SUB_OPEN(3) β¨
okay bestie, welcome to the NNG Reference Manual π this is the page for nng_sub_open and it's literally your backstage pass to making a brand new sub socket. pull up a chair, we're doing this together π«Ά
πΈ NAME πΈ
nng_sub_open β create sub socket β¨
π SYNOPSIS π
#include <nng/nng.h>
#include <nng/protocol/pubsub0/sub.h>
int nng_sub0_open(nng_socket *s);
int nng_sub0_open_raw(nng_socket *s);
π DESCRIPTION π
so like, there's two functions here and they're sisters, not twins, okay?
nng_sub0_open()β this one makes a sub version 0 socket and hands it back to you at the location thatsis pointing at. that's it, that's the whole job πnng_sub0_open_raw()β same energy, BUT it makes a sub version 0 socket in raw mode and returns it at the spotspoints to. raw mode is the unhinged one, iykyk π₯
ngl, the "at the location pointed to by s" part matters β you're passing a pointer, she's writing the socket into it. no cap. π
π RETURN VALUES π
- returns
0when it ate and left no crumbs β - returns non-zero otherwise (aka when it did NOT work, sorry bestie π)
π ERRORS π
here's the vibe check on what can go wrong:
NNG_ENOMEMβ insufficient memory is available π§ π₯ girl is out of RAM, that's it, that's the problem.NNG_ENOTSUPβ the protocol is not supported π like... it's just not in the building.
π SEE ALSO π
go read these next, they're iconic:
okay that's the whole page babe, you're officially a sub socket girly now π¦ this was the NNG Reference Manual, dated 2026-06-30, and honestly? she ate. periodt π β¨π
π¦ 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