NNG_PAIR_OPEN(3)

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

πŸ’– NNG_PAIR_OPEN(3) πŸ’–

okay bestie, welcome to the NNG Reference Manual β€” this is the page that teaches you how to create a pair socket ✨ (yes that's the NAME, we're being so official about it)


🌸 NAME 🌸

nng_pair_open β€” create pair socket


πŸŽ€ SYNOPSIS πŸŽ€

πŸ’… Version 0

#include <nng/protocol/pair0/pair.h>

int nng_pair0_open(nng_socket *s);

int nng_pair0_open_raw(nng_socket *s);

πŸ’… Version 1

#include <nng/protocol/pair1/pair.h>

int nng_pair1_open(nng_socket *s);

int nng_pair1_open_raw(nng_socket *s);

int nng_pair1_open_poly(nng_socktet *s);

(and yes babes, nng_socktet in that last one is exactly how it's written in the source, we are NOT touching it, no cap 😭)


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, nng_pair0_open() and nng_pair1_open()? they create a pair socket for you β€” version 0 or version 1 respectively β€” and they hand it back to you at the location that s is pointing at. it's giving personal delivery service, honestly πŸ’–

then nng_pair0_open_raw() and nng_pair1_open_raw() do basically the same lil thing but they create the pair version 0 or version 1 socket in raw mode and return it at the location pointed to by s. raw mode girlies, you know who you are ✨

and nng_pair1_open_poly() opens up a pair version 1 socket in polyamorous mode. yes. that's really what it's called. i don't make the rules 🫢

🚨 Note 🚨 Polyamorous mode is deprecated and should not be used in new applications. the nng_pair1_open_poly() function will likely be removed in a future release. so like… don't build your whole personality around it, bestie πŸ’€

⭐ RETURN VALUES ⭐

these functions return 0 on success, and non-zero otherwise. zero is the slay, non-zero is the "girl what happened" number πŸ™ˆ


πŸ”₯ ERRORS πŸ”₯

  • NNG_ENOMEM β€” insufficient memory is available. it's not you, it's the RAM 😭
  • NNG_ENOTSUP β€” the protocol is not supported. vibe check failed, this one's a no πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page, you ate it, you understood it, periodt πŸ’… NNG Reference Manual energy, dated 2026-06-30, and the page you just read is NNG_PAIR_OPEN(3). go make some sockets bestie, ily πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from