NNG_HTTP_HANDLER_SET_DATA(3http)
π NAME π
okay bestie, welcome to the NNG_HTTP_HANDLER_SET_DATA(3http) page from the NNG Reference Manual. The main character here is nng_http_handler_set_data β set extra data for HTTP handler. No cap. β¨
π¦ SYNOPSIS π¦
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
int nng_http_handler_set_data(nng_http_handler *handler, void *data,
void (*dtor)(void *));
πΈ DESCRIPTION πΈ
The nng_http_handler_set_data() function is literally there to set some extra additional data for the handler. The stored data can be retrieved later in the handler function using nng_http_handler_get_data(). Obsessed. π«Ά
Additionally, when the handler is deallocated, if dtor is not NULL, then dtor will be called with data as its argument. The intended use of this function is deallocate any resources associated with data. Periodt. π
π RETURN VALUES π
This function returns 0 on success, and non-zero otherwise. That's the whole vibe check. β
π₯ ERRORS π₯
NNG_ENOMEMβ insufficient free memory to perform the operation. πNNG_ENOTSUPβ no support for HTTP in the library. π
π SEE ALSO π
nng_http_handler_alloc(3http)nng_http_server_get_data(3http)nng_http_server_add_handler(3http)nng(7)
that's the whole page, bestie π«Ά from the NNG Reference Manual, dated 2026-01-13. slay π
π¦ 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