Apply PIE to nghttpx
[platform/upstream/nghttp2.git] / doc / nghttp2_session_terminate_session.rst
1
2 nghttp2_session_terminate_session
3 =================================
4
5 Synopsis
6 --------
7
8 *#include <nghttp2/nghttp2.h>*
9
10 .. function:: int nghttp2_session_terminate_session(nghttp2_session *session, uint32_t error_code)
11
12     
13     Signals the session so that the connection should be terminated.
14     
15     The last stream ID is the minimum value between the stream ID of a
16     stream for which :type:`nghttp2_on_frame_recv_callback` was called
17     most recently and the last stream ID we have sent to the peer
18     previously.
19     
20     The *error_code* is the error code of this GOAWAY frame.  The
21     pre-defined error code is one of :macro:`nghttp2_error_code`.
22     
23     After the transmission, both `nghttp2_session_want_read()` and
24     `nghttp2_session_want_write()` return 0.
25     
26     This function should be called when the connection should be
27     terminated after sending GOAWAY.  If the remaining streams should
28     be processed after GOAWAY, use `nghttp2_submit_goaway()` instead.
29     
30     This function returns 0 if it succeeds, or one of the following
31     negative error codes:
32     
33     :macro:`NGHTTP2_ERR_NOMEM`
34         Out of memory.