NNG_STREAM(5)
π NNG_STREAM π (that's the NNG_STREAM(5) page, bestie, from the NNG Reference Manual)
β¨ NAME β¨
nng_stream β a byte stream π¦
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
typedef struct nng_stream nng_stream;
π DESCRIPTION π
okay so. an nng_stream is literally just a byte stream. that's it, that's the whole vibe. it might be sitting on top of some underlying connection, like a TCP connection, or a connected UNIX domain socket, or a named pipe. iykyk π
Note π thenng_streamobject is for raw byte stream connections, and you should not confuse it with a pipe object, which gets created on a socket usingnng_listen(),nng_dial()or other functions in that family. two completely different girls, do not mix them up π
these objects get created in one of two ways:
- you make an outgoing connection with
nng_stream_dialer_dial(), or - you accept an incoming connection with
nng_stream_listener_accept()
byte streams are reliable, meaning the data will not show up out of order, and it won't show up with portions missing. no crumbs lost, no order scrambled, periodt β¨
you send data with nng_stream_send(), and you receive data with nng_stream_recv(). that's the whole friendship right there π«Ά
when you're done with the connection and don't need it anymore, it should be freed with nng_stream_free(). let her rest, she's earned it π
Tip π you can close the connection without freeing it, by using nng_stream_close(). closing β freeing, bestie, they are different things.
byte streams may support various options, depending on the underlying technology β you get at those options with the nng_stream_get() and nng_stream_set() family of functions. it's giving "flexible, depending on who she's built on" π
π SEE ALSO π
libnng(3)nng_stream_close(3str)nng_stream_dialer_dial(3str)nng_stream_free(3str)nng_stream_get(3str)nng_stream_listener_accept(3str)nng_stream_recv(3str)nng_stream_send(3str)nng_stream_set(3str)nng_options(5)nng(7)
and that's the page!! this one came straight out of the NNG Reference Manual, dated 2026-06-30 β so go forth, talk to your byte streams, and slay πβ¨ππ¦πΈπ π
π¦ 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