NNG_STAT_FIND_SOCKET(3)
π 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
NULLif 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 π
libnng(3)nng_stat_child(3)nng_stat_find(3)nng_stat_find_dialer(3)nng_stat_find_listener(3)nng_stats_get(3)nng_stat(5)nng(7)
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
- 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