NNG_STREAM(5)

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

πŸ’– 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 πŸŽ€ the nng_stream object is for raw byte stream connections, and you should not confuse it with a pipe object, which gets created on a socket using nng_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 🌟


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