NNG_HTTP_SERVER_STOP(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸŽ€ NNG_HTTP_SERVER_STOP(3http) πŸŽ€

okay bestie, this is the NNG Reference Manual page for NNG_HTTP_SERVER_STOP(3http) β€” and yes, we're gonna make HTTP server shutdown make sense. πŸ’…


🌸 NAME 🌸

nng_http_server_stop β€” stop HTTP server


✨ SYNOPSIS ✨

#include <nng/nng.h>
#include <nng/supplemental/http/http.h>

void nng_http_server_stop(nng_http_server *server);

πŸ’– DESCRIPTION πŸ’–

The nng_http_server_stop() function literally undoes the effect of nng_http_server_start(). No cap.

Each call to nng_http_server_start() acts as a reference count, and it should be matched by a call to nng_http_server_stop(). When the reference count drops to zero, that's when the server is actually stopped, and existing open connections to it are closed. 🫢

This function does not wait for the connections to close. It's giving "I closed the door, I'm not standing there watching everyone leave" energy. 😭

πŸ’€ Note: Once the server instance is actually stopped, it cannot be started again, and any future calls to nng_http_server_hold() will return a new instance of the server. It is expected that the caller will follow this function call with a call to nng_http_server_release().

🌈 RETURN VALUES 🌈

None.


πŸ¦‹ ERRORS πŸ¦‹

None.


πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ this cutie came from the NNG Reference Manual, dated 2026-01-13, and the page is NNG_HTTP_SERVER_STOP(3http). slay. πŸ‘‘

πŸ“¦ where this page comes from