NNG_STAT_FIND_SOCKET(3)

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

πŸ’– NNG_STAT_FIND_SOCKET(3) πŸ’–

okay bestie, welcome to the NNG Reference Manual β€” yes it's a real manual page, yes it's about finding your socket's stats, and yes we're gonna make it cute. this one's nng_stat_find_socket, and it's literally just "where my socket stats at" the function. 🫢


✨ NAME ✨

nng_stat_find_socket β€” find socket statistics πŸ”πŸ’…


🌸 SYNOPSIS 🌸

#include <nng/nng.h>

typedef struct nng_stat nng_stat;
typedef struct nng_socket nng_socket;

nng_stat *nng_stat_find_socket(nng_stat *stat, nng_socket socket);

like, copy that exactly, no cap β€” those typedefs are doing heavy lifting so you don't have to write struct everywhere like some kind of Victorian. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so the way that nng_stat_find_socket() works is: it hands you back the statistics tree inside stat that's associated with the socket socket β€” if such a tree exists. and if it doesn't exist? boom, NULL. no tree, no vibes, no nothing. πŸ’€

and generally β€” okay this is the fun part β€” there will be child statistics hanging off the value it returns, each one corresponding to a specific metric. so it's giving tree energy, main character forest. 🌲✨

you can scan those children further either with nng_stat_find(3) or by just walking the tree with nng_stat_child(3). pick your fighter, both slay. πŸŽ€


πŸ’œ RETURN VALUES πŸ’œ

  • the matching statistic, bestie 🫢 β€” the one you asked for
  • or NULL if no match is found 😭 (it happens, it's not personal)

🌈 ERRORS 🌈

None. zero. not a single one. iconic behaviour honestly, we love a function with no drama. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

go read them, iykyk πŸ¦‹


and that's a wrap on NNG_STAT_FIND_SOCKET(3) β€” dated 2026-06-30, straight out of the NNG Reference Manual, looking cute as ever. mwah, stan a stats function, periodt. πŸ’–πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from