HANDLER_NOTIFY_CLOSE(3)

NAME
handler_notify_close - tell a web server handler object to close gracefully

SYNOPSIS

#include <libweb/handler.h>

int handler_notify_close(struct handler *h);

DESCRIPTION
The handler_notify_close(3) function notifies h to exit the loop entered to by handler_loop(3). h must have been returned by a previous call to handler_alloc(3). This function is async-signal-safe, so it can be safely called from a signal handler. This is intentional, as applications would typically want to close the server on specific signals, such as SIGINT or SIGTERM.

RETURN VALUE
On success, zero is returned. On error, a negative integer is returned.

ERRORS
No errors are defined.

SEE ALSO
handler_alloc(3), handler_loop(3), libweb_handler(7).

COPYRIGHT
Copyright (C) 2023-2024 libweb contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.