NNG_MSG_GET_PIPE(3)

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

✨ nng_msg_get_pipe(3) β€” NNG Reference Manual ✨

okay bestie, welcome to another episode of NNG Reference Manual, the show where we explain Unix networking functions but make it cute πŸ’– today's main character is nng_msg_get_pipe, and she is iconic.


🌸 NAME 🌸

nng_msg_get_pipe β€” get pipe for message πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <nng/nng.h>

nng_pipe nng_msg_get_pipe(nng_msg *msg);

like, that's it. one function. one argument. she's lowkey effortless πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so basically, nng_msg_get_pipe() returns the nng_pipe object that's associated with the message msg. that's the whole vibe ✨

and the meaning of that pipe depends on which direction the message is going, which is kind of giving duality ngl:

  • when you're receiving, this is the pipe the message was actually received from πŸ“₯
  • when you're transmitting, this would be the pipe the message should be delivered to, if you need a specific peer 🎯
Note: not all protocols support overriding the destination pipe. so don't just assume you can boss the message around, bestie 😭 some protocols are like "no. we choose the route."

the most usual use case for this (and honestly the one you'll be obsessed with) is getting info about the peer a message came from 🫢 like, you can behave differently for different peers β€” for example, a higher level of authentication for peers chillin' on an untrusted network πŸ”₯ and for exactly that situation, the nng_pipe_getopt() function is your girl. she's useful here. periodt.


πŸ’œ RETURN VALUES πŸ’œ

the function hands you back the pipe associated with this message, and that value will be a positive value πŸŽ€

if the pipe comes back non-positive, that's the signal that no specific pipe is associated with the message. no pipe, no vibe, just a shrug πŸ™ˆ


πŸ’€ ERRORS πŸ’€

None. literally zero errors. she doesn't even have a bad day. slay πŸ’…


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! no cap, it's giving short-but-essential πŸ’–

this has been nng_msg_get_pipe(3) from the NNG Reference Manual, dated 2026-06-30 🌸 stay hydrated, read your man pages, and go get that pipe 🫢✨
πŸ“¦ where this page comes from