NNG_HTTP_HANDLER_SET_DATA(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’– 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 🌈


that's the whole page, bestie 🫢 from the NNG Reference Manual, dated 2026-01-13. slay πŸ’œ

πŸ“¦ where this page comes from