NNG_PIPE(5)
β¨ NAME β¨
nng_pipe β the communications pipe, bestie π (you're reading the NNG_PIPE(5) page of the NNG Reference Manual, and yes we're doing this whole thing together, grab a snack π)
π SYNOPSIS π
#include <nng/nng.h>
typedef struct nng_pipe_s nng_pipe;
π DESCRIPTION π
Okay so picture this: an nng_pipe is a handle to a pipe object, and a pipe object is basically just one single connection. And honestly? In most cases that's literally, actually true β the pipe is the abstraction for one single TCP or IPC connection. No cap. π
Every pipe is associated with either the listener or the dialer that created it, which means it's also automatically associated with a single socket. The way it all chains togetherβ¦ it's giving network family tree. π
Important π¨ The nng_pipe structure is always passed by value β for input parameters and for return values β and it should be treated opaquely. Do not go poking around inside it, okay? Passing structures this way gives the compiler a chance to perform accurate type checks in functions passing values of this type, so likeβ¦ let the compiler do its lil job. π
Tip π«Ά Most applications should never concern themselves with individual pipes at all, fr fr. But it is possible to access a pipe when more information about the source of a message is needed, or when more control is required over message delivery. So if you need the receipts, the pipe has them. π
Pipe objects are created by dialers (nng_dialer objects) and listeners (nng_listener objects). That's their origin story, periodt. β¨
Pipe objects may be destroyed by the nng_pipe_close() function. They also get closed when the dialer or listener that created them is closed, or when the remote peer closes the underlying connection. So the relationship can end from either side. π Lowkey tragic but highkey correct.
πΈ Initialization πΈ
A pipe may be initialized using the macro NNG_PIPE_INITIALIZER before it's opened, so there's no confusion with a valid open pipe. A whole "this seat is empty, not taken" situation. πͺ
For example:
nng_pipe p = NNG_PIPE_INITIALIZER;
π₯ SEE ALSO π₯
nng_msg_get_pipe(3)nng_pipe_close(3)nng_pipe_getopt(3)nng_pipe_dialer(3)nng_pipe_id(3)nng_pipe_listener(3)nng_pipe_socket(3)nng_dialer(5)nng_listener(5)nng_options(5)nng(7)
And that's a wrap, bestie π this was the NNG_PIPE(5) page from the NNG Reference Manual β version dated 2026-06-30 β so go forth, treat your pipes opaquely, and stay iconic. Mwah ππ¦
π¦ 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