aboutsummaryrefslogtreecommitdiff
path: root/doc/man3/handler_notify_close.3
blob: 3cc41303934daf45350c724612f165cde24b43fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.TH HANDLER_NOTIFY_CLOSE 3 2024-07-13 0.4.0 "libweb Library Reference"

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

.SH SYNOPSIS
.LP
.nf
#include <libweb/handler.h>
.P
int handler_notify_close(struct handler *\fIh\fP);
.fi

.SH DESCRIPTION
The
.IR handler_notify_close (3)
function notifies
.I h
to exit the loop entered to by
.IR handler_loop (3).
.IR h
must have been returned by a previous call to
.IR handler_alloc (3).

This function is
.IR 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
.I SIGINT
or
.IR SIGTERM .

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

.SH ERRORS
No errors are defined.

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

.SH COPYRIGHT
Copyright (C) 2023-2024 libweb contributors
.P
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.