nghttp2_conn_client_new

Synopsis

#include <nghttp2v2/nghttp2.h>

int nghttp2_conn_client_new(nghttp2_conn **pconn, const nghttp2_callbacks *callbacks, const nghttp2_settings *settings, const nghttp2_mem *mem, void *user_data)

nghttp2_conn_client_new() creates new nghttp2_conn as a client. If it succeeds, it assigns the pointer to the object to *pconn. callbacks and settings must not be NULL, and the function makes a copy of each of them. user_data is the arbitrary pointer which is passed to the user-defined callback functions. mem is a memory allocator. If mem is NULL, the memory allocator returned by nghttp2_mem_default() is used.

Call nghttp2_conn_del() to free memory allocated for *pconn.

This function returns 0 if it succeeds, or one of the following negative error codes:

NGHTTP2_ERR_NOMEM

Out of memory.