NNG_REQ_OPEN(3)
π NAME π
nng_req_open β bestie, this is the one that creates a req socket β¨
πΈ SYNOPSIS πΈ
okay so first you gotta pull in the headers, no cap:
#include <nng/nng.h>
#include <nng/protocol/reqrep0/req.h>
and then the two main character functions:
int nng_req0_open(nng_socket *s);
int nng_req0_open_raw(nng_socket *s);
π¦ DESCRIPTION π¦
So like, there's two of them and they're siblings, not twins, ok?
The nng_req0_open() function creates a req version 0 socket and hands it back to you at the location pointed to by s. That's it. That's the whole vibe. π
Then there's the feral one: nng_req0_open_raw() creates a req version 0 socket in raw mode and returns it at the location pointed to by s. Same deal, just raw β iykyk.
literally both of them write the socket intos, so make suresis actually a realnng_socketpointer, bestie, don't play with me π
β RETURN VALUES β
These functions return 0 on success, and non-zero otherwise. So 0 is the slay, anything else is the π.
π ERRORS π
NNG_ENOMEMβ there's not enough memory available. She's hungry, she needs RAM, go feed her πNNG_ENOTSUPβ the protocol is not supported. Not every build ships with every protocol, so this one can absolutely show up and it's not your fault, it's giving build-config energy π§
π SEE ALSO π
that's the whole page bestie, go open that socket π«Άβ¨
this was NNG_REQ_OPEN(3) from the NNG Reference Manual, dated 2026-06-30 π
π¦ 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