NNG_PUB_OPEN(3)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

πŸ’… NNG_PUB_OPEN(3) β€” the NNG Reference Manual, but make it cute

okay bestie, listen up, because this one is literally the doorway to being a broadcaster πŸ‘‘


✨ NAME ✨

nng_pub_open β€” create pub socket 🎀


🌸 SYNOPSIS 🌸

#include <nng/nng.h>
#include <nng/protocol/pubsub0/pub.h>

int nng_pub0_open(nng_socket *s);

int nng_pub0_open_raw(nng_socket *s);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, lovely. The nng_pub0_open() function creates a pub version 0</> socket and hands it back to you at the location that s points to. That's it, that's the whole vibe ✨

And the nng_pub0_open_raw() function? She creates a pub version 0 socket but in raw mode πŸ’€ and returns it at the location pointed to by s. Yes queen, raw mode is its own whole personality, iykyk.

heads up: both of these drop the socket into whatever nng_socket *s is pointing at, so make sure s is actually pointing somewhere real, bestie. No vibes-only pointers πŸ’–

πŸŽ€ RETURN VALUES πŸŽ€

These functions return 0 on success, and non-zero otherwise. That's the whole report card. 0 = slay, anything else = not slay 😭


πŸ”₯ ERRORS πŸ”₯

  • NNG_ENOMEM β€” Insufficient memory is available. like the laptop is going through it πŸ’€
  • NNG_ENOTSUP β€” The protocol is not supported. she's just not available for this, no cap πŸ™ˆ

πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie 🫢 this was the NNG Reference Manual, dated 2026-06-30, and honestly? iconic. go open a pub socket and be the main character you were always meant to be πŸ‘‘πŸŒΈβœ¨

πŸ“¦ where this page comes from