dwnx_conn_server_new

Synopsis

#include <dwnx/dwnx.h>

int dwnx_conn_server_new(dwnx_conn **pconn, const dwnx_callbacks *callbacks, const dwnx_settings *settings, const dwnx_transport_params *params, const dwnx_mem *mem, void *user_data)

dwnx_conn_server_new() creates new dwnx_conn as a server. If it succeeds, it assigns the pointer to the object to *pconn. callbacks, settings, and params must not be NULL, and the function makes a copy of each of them. params is the local transport parameters, and sent to a remote endpoint during handshake. 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 dwnx_mem_default() is used.

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

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

DWNX_ERR_NOMEM

Out of memory.