NNG_IOV(5)
π NNG_IOV β scatter/gather element π¦
okay bestie, welcome to the NNG Reference Manual, page NNG_IOV(5) β yes it's a section 5 page, it's a struct, and it's giving structured data realness β¨
πΈ NAME πΈ
nng_iov β scatter/gather element. that's it, that's the whole name, and honestly? iconic. π
β¨ SYNOPSIS β¨
#include <nng/nng.h>
typedef struct {
void * iov_buf;
size_t iov_len;
} nng_iov;
no cap, that's the whole struct. two fields. she's simple, she's efficient, she's thriving. π
π«Ά DESCRIPTION π«Ά
so like, an nng_iov structure represents a single element in a scatter/gather array. think of it as one lil' sticky note in a big pile of sticky notes, where each note says "hey, here's a chunk of memory, go get it".
some operations can use arrays of these to access different regions of memory in a single operation. for example β and this is the classic slay β it may be useful to send a message with header data from one part of memory, and a user payload from another. two memory neighborhoods, one op. no copy, no drama, no extra steps. it's giving zero-copy main character energy fr fr. π
the operations that do this typically store an array of these in an nng_aio structure using the nng_aio_set_iov() function. so that's the pipeline: you build the iovs, the aio holds them, the operation goes brrr. π
π§ The Structure Members (yes, both of them, we're not skipping anyone)
iov_bufβ this is a pointer to the first byte within the memory being referenced by this scatter/gather element. like, the starting address. the doorway. the entrance. πͺβ¨iov_lenβ this is the size in bytes of this scatter/gather element. how much memory we're talking about, measured in bytes, because that's how we count around here. π
lowkey important: both of these fields are listed as present in the structure, and they both matter for every iov you ever build. don't skip iov_len, bestie, or the operation won't know where your data ends and that's a whole mess. π
π SEE ALSO π
nng_aio_set_iov(3)β the function that tucks your iov array into an aio π«Άnng_aio(5)β the async i/o structure holding all this together πnng(7)β the big picture, the mothership, the whole vibe β
okay that's the page!! NNG Reference Manual, dated 2026-06-30, filed under NNG_IOV(5). go forth and scatter/gather responsibly, bestie ππ¦β¨
π¦ 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