int nghttp2_session_callbacks_new
(nghttp2_session_callbacks* *callbacks_ptr)
int nghttp2_session_client_new
(nghttp2_session* *session_ptr, const nghttp2_session_callbacks* callbacks, void* user_data)
*session_ptr
给客户端使用,回调的所有成员被复制到*session_ptr
,因此*session_ptr
不存储回调,user_data
是任意用户提供的数据,将被传递给回调函数.int nghttp2_submit_settings
(nghttp2_session* session, uint8_t* flags*, const nghttp2_settings_entry* iv, size_t* niv*)
int32_t nghttp2_submit_request
(nghttp2_session* session, const nghttp2_priority_spec* pri_spec, const nghttp2_nv* nva, size_t* nvlen*, const nghttp2_data_provider* data_prd, void* stream_user_data)
void nghttp2_session_callbacks_set_send_callback
(nghttp2_session_callbacks* cbs, nghttp2_send_callback* send_callback*)
void nghttp2_session_callbacks_set_recv_callback
(nghttp2_session_callbacks* cbs, nghttp2_recv_callback* recv_callback*)
void nghttp2_session_callbacks_set_on_data_chunk_recv_callback
(nghttp2_session_callbacks* cbs, nghttp2_on_data_chunk_recv_callback* on_data_chunk_recv_callback*)
void nghttp2_session_callbacks_set_on_header_callback
(nghttp2_session_callbacks* cbs, nghttp2_on_header_callback* on_header_callback*)
void nghttp2_session_callbacks_set_on_stream_close_callback
(nghttp2_session_callbacks* cbs, nghttp2_on_stream_close_callback* on_stream_close_callback*)
void * nghttp2_session_get_stream_user_data
(nghttp2_session* session, int32_t* stream_id*)
stream_id
的流的stream_user_data
,stream_user_data
由nghttp2_submit_request
,nghttp2_submit_headers
,nghttp2_session_set_stream_user_data
提供int nghttp2_submit_rst_stream
(nghttp2_session* session, uint8_t* flags*, int32_t* stream_id*, uint32_t* error_code*)
error_code
的流stream_idint nghttp2_session_send
(nghttp2_session* session)