NNG_MSG_GET_PIPE(3)
β¨ 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
- 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