NNG_BUS_OPEN(3)
β¨ 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
- 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