NNG_MSG(5)

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

πŸ’Œ NAME πŸ’Œ

nng_msg β€” the message, bestie. the actual lil packet of vibes.


✨ SYNOPSIS ✨

#include <nng/nng.h>

typedef struct nng_msg nng_msg;

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: an nng_msg is one single message sent between Scalability Protocols peers. that's the whole job. one message, one vibe.

and inside? she's got layers πŸ’…:

  • a body β€” this holds the application supplied payload, aka the actual content you care about
  • a header β€” this holds protocol specific routing and similar related information

so yeah, the body is the main character and the header is the backstage crew making sure everything gets where it's going. πŸŽ€

✨ Tip ✨ using message-oriented functions is a good way to reduce the likelihood of data copies and improve application performance. no cap, it's giving efficiency. πŸ”₯

messages get allocated with the nng_msg_alloc() function, and they get deallocated with the nng_msg_free() function. that's the birth and the farewell, iconically. 🫢


and there's more β€” other functions exist to access message contents, including:

  • adding data to either the beginning or the end of the message
  • automatic data conversion
  • removing data from the beginning or end

these functions are designed to try to avoid copying message contents by making use of scratch areas at the beginning and end of the message. the way that these lil functions just dodge the copies entirely... genuinely obsessed. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘


that's the whole page bestie, stan nng_msg, periodt πŸ’…βœ¨

this was NNG_MSG(5) from the NNG Reference Manual, dated 2026-06-30 β€” mwah, love u, go read the rest of the NNG reference manual, iykyk πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from