NN_TERM(3compat)
π
NN_TERM (3compat) β aka the nn_term page, bestie edition
okay so this is the compat-API page for nn_term β it lives in section 3compat of the NNG reference manual, and ngl it's a short one but it's important so pay attention π
β¨ NAME β¨
nn_term β terminate library (compatible API)
like, the whole vibe is "shut it all down." periodt. π«Ά
πΈ SYNOPSIS πΈ
#include <nanomsg/nn.h>
void nn_term(void);
no args, no return value, no nothing. it's giving minimal. it's giving clean. π
π¦ DESCRIPTION π¦
The nn_term() function closes any open sockets, and frees all resources allocated by the library. Any operations that are currently in progress will be terminated, and will fail with error EBADF or ETERN. iconic cleanup behavior honestly β¨
Note π§ This function is provided for API compatibility with legacy libnanomsg. Consider using the relevant modern API instead.
Important π This function is not thread-safe, and is not suitable for use in library calls. The intended purpose of this is to clean up at application termination; for example by registering this function with atexit(). This can help prevent false leak reports caused when memory checkers notice global resources allocated by the library. Libraries should never use this function, but should explicitly close their own sockets directly.
like... fr fr, don't be out here calling nn_term() from inside your library. that's not main character energy, that's just chaos π. use atexit() at app teardown and let it slay. and if you're writing a library, close your own sockets directly, bestie β that's the move. π
β RETURN VALUES β
None. literally nothing comes back, it just does the thing. π
π ERRORS π
None. no errors reported, she's unbothered. π
π SEE ALSO π
iykyk, go read those next π
okay that's the whole page, you ate that π«Ά this was the NNG Reference Manual, dated 2026-01-13, and the page is NN_TERM(3compat) β mwah, bye bestie! π
β¨
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms