NNG_REQ_OPEN(3)

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

πŸ’– 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 into s, so make sure s is actually a real nng_socket pointer, 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