NNG_PIPE_ID(3)

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

πŸ’– NNG_PIPE_ID(3) β€” the nng_pipe_id girlies' manual πŸ’–

okay so this is a page from the NNG Reference Manual, and it's abt one (1) tiny little function that hands u a pipe's numeric id. that's it. that's the whole vibe. but she's iconic so let's talk abt her πŸŽ€


✨ NAME ✨

nng_pipe_id β€” return numeric pipe identifier πŸ’…


🌸 SYNOPSIS 🌸

#include <nng/nng.h>

int nng_pipe_id(nng_pipe p);

like. look at her. one include, one function, no notes. slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

so nng_pipe_id() returns a positive identifier for the pipe p, bestie β€” but only if p is valid. if she's not valid? u get -1. that's the whole deal. no cap.

πŸ“Œ Note (listen up, this part matters) a pipe counts as valid if it was ever created by the socket. that's the bar. that's the whole test. now here's the part where u could get got πŸ™ˆ β€” pipes that are allocated on the stack or statically should be initialized with the macro NNG_PIPE_INITIALIZER so they can't get confused with a valid pipe. literally just do it. it's giving "uninitialized garbage pretending to be a real pipe" and we are NOT doing that in this house πŸ’€

⭐ RETURN VALUES ⭐

she returns the positive value for the pipe identifier 🫢 β€” or -1 if the pipe is invalid. that's it. that's the return value. no in-between, no "it depends", periodt.


πŸ‘‘ ERRORS πŸ‘‘

None. literally none. zero. zilch. she said "i don't do errors" and honestly? respect πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯


and that's the page!! go forth and check ur pipe ids responsibly, and remember: initialize ur stack pipes with NNG_PIPE_INITIALIZER or the vibe check will fail u 🌈✨

mwah πŸ’‹ β€” this was the NNG Reference Manual, dated 2026-06-30. xoxo, ur local Unix girlie πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from