NNG_BUS_OPEN(3)

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

✨ NNG_BUS_OPEN(3) ✨

okay bestie, welcome to the NNG Reference Manual πŸ’– today we're talking about nng_bus_open β€” aka the "create bus socket" page. yes that's the actual NAME line, i'm not being cute, it's literally called that. anyway sit down, hydrate, let's go 🫢


πŸŽ€ NAME πŸŽ€

nng_bus_open β€” create bus socket

lowkey the whole page in four words. iconic.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <nng/nng.h>
#include <nng/protocol/bus0/bus.h>

int nng_bus0_open(nng_socket *s);

int nng_bus0_open_raw(nng_socket *s);

like, both of these are right there in the synopsis, both take the same arg, name is nng_bus_open but the functions are nng_bus0_open and nng_bus0_open_raw β€” that's just how it is, don't look at me πŸ™ˆ


🌸 DESCRIPTION 🌸

okay so, the tea β˜•

The nng_bus0_open() function creates a bus version 0 socket and returns it at the location pointed to by *s. that's the whole thing. it makes you a bus socket, version 0, and hands it back through that pointer. slay πŸ’…

The nng_bus0_open_raw() function creates a bus version 0 socket in raw mode, and returns it at the location pointed to by s. same pointer spot, same version 0 bus socket, except this one is *raw. different vibe, still a bus.

bestie note: bus version 0, not bus version "whatever you felt like". the 0 is doing real work here πŸ”₯

πŸ‘‘ RETURN VALUES πŸ‘‘

These functions return 0 on success, and non-zero otherwise. that's it, that's the whole contract. zero = we ate. non-zero = we did not eat, check the errors section below 😭


πŸ’€ ERRORS πŸ’€

the ways these can go wrong, and fr fr they can:

  • NNG_ENOMEM β€” insufficient memory is available. you asked for a socket, the machine said "i have no thoughts, only vibes, and zero free bytes". free something up and try again πŸ“
  • NNG_ENOTSUP β€” the protocol is not supported. the bus protocol just isn't in this build, bestie. not your fault, not the socket's fault, it's a build-config thing. periodt.

🌈 SEE ALSO 🌈

go read these next, i promise they're worth it:

iykyk, the (5) and (7) sections are where the real lore lives 🧚


πŸ’œ SIGN-OFF πŸ’œ

and that's the page!! written under the NNG Reference Manual, dated 2026-06-30, footer reading NNG_BUS_OPEN(3) because that's the name of the page and we don't play about that. go make a bus socket, you're gonna do great, no cap πŸŒŸπŸ’–βœ¨

πŸ“¦ where this page comes from