tizen 2.4 release
[external/nghttp2.git] / doc / apiref-header.rst
1 API Reference
2 =============
3
4 Includes
5 --------
6
7 To use the public APIs, include ``nghttp2/nghttp2.h``::
8
9     #include <nghttp2/nghttp2.h>
10
11 The header files are also available online: :doc:`nghttp2.h` and
12 :doc:`nghttp2ver.h`.
13
14 Remarks
15 -------
16
17 Do not call `nghttp2_session_send()`, `nghttp2_session_mem_send()`,
18 `nghttp2_session_recv()` or `nghttp2_session_mem_recv()` from the
19 nghttp2 callback functions directly or indirectly. It will lead to the
20 crash.  You can submit requests or frames in the callbacks then call
21 these functions outside the callbacks.
22
23 Currently, `nghttp2_session_send()` and `nghttp2_session_mem_send()`
24 do not send client connection preface
25 (:macro:`NGHTTP2_CLIENT_CONNECTION_PREFACE`).  The applications are
26 responsible to send it before sending any HTTP/2 frames using these
27 functions if :type:`nghttp2_session` is configured as client.
28 Similarly, `nghttp2_session_recv()` and `nghttp2_session_mem_recv()`
29 do not consume client connection preface unless
30 `nghttp2_option_set_recv_client_preface()` is used with nonzero option
31 value.  The applications are responsible to receive it before calling
32 these functions if :type:`nghttp2_session` is configured as server and
33 `nghttp2_option_set_recv_client_preface()` is not used.