1
2nghttp2_session_terminate_session2
3==================================
4
5Synopsis
6--------
7
8*#include <nghttp2/nghttp2.h>*
9
10.. function:: int nghttp2_session_terminate_session2(nghttp2_session *session, int32_t last_stream_id, uint32_t error_code)
11
12
13    Signals the session so that the connection should be terminated.
14
15    This function behaves like `nghttp2_session_terminate_session()`,
16    but the last stream ID can be specified by the application for fine
17    grained control of stream.  The HTTP/2 specification does not allow
18    last_stream_id to be increased.  So the actual value sent as
19    last_stream_id is the minimum value between the given
20    *last_stream_id* and the last_stream_id we have previously sent to
21    the peer.
22
23    The *last_stream_id* is peer's stream ID or 0.  So if *session* is
24    initialized as client, *last_stream_id* must be even or 0.  If
25    *session* is initialized as server, *last_stream_id* must be odd or
26    0.
27
28    This function returns 0 if it succeeds, or one of the following
29    negative error codes:
30
31    :macro:`nghttp2_error.NGHTTP2_ERR_NOMEM`
32        Out of memory.
33    :macro:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT`
34        The *last_stream_id* is invalid.
35