NNG_CTX_ID(3)

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

✨ NAME ✨

nng_ctx_id β€” bestie, it hands you back the numeric id of a context πŸ’…

It's a lil function from the NNG Reference Manual, and it is genuinely so simple it's giving main character energy.


🌸 SYNOPSIS 🌸

#include <nng/nng.h>

int nng_ctx_id(nng_ctx c);

πŸŽ€ DESCRIPTION πŸŽ€

okay so. nng_ctx_id() gives you a positive identifier for the context c β€” but ONLY if that context is valid, no cap. If it's not valid? It returns -1. that's it, that's the whole vibe πŸ¦‹

Note πŸ™ˆ A context counts as valid if it was ever opened with the nng_ctx_open() function. So if you've got contexts chillin' on the stack or declared statically, you should initialize them with the macro NNG_CTX_INITIALIZER so they literally cannot get confused with a valid context before they've been opened. protect your peace (and your ids) 🫢

πŸ’– RETURN VALUES πŸ’–

  • It returns the positive value of the context identifier πŸ’…
  • Or -1 if the context is invalid 😭

πŸ’€ ERRORS πŸ’€

None. not a single one. flawless. iconic. zero problems. periodt ✨


πŸ‘‘ SEE ALSO πŸ‘‘


that's the whole page, bestie β€” short, sweet, and it ate πŸŒˆπŸ’œ

signing off with the receipts: this was the NNG Reference Manual, dated 2026-06-30 πŸŽ€ tysm for reading, mwah πŸ’–

πŸ“¦ where this page comes from