Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Like for every hook functions, it's only available when the µC/HTTP-client internal task is active (HTTPc_CFG_MODE_ASYNC_TASK_EN). This hook is mandatory when the internal task is enabled and can be set up with the API functionHTTPc_ConnSetParam() with the parameter type HTTPc_PARAM_TYPE_CONN_CLOSE_CALLBACK.

Prototype

Code Block

          void  HTTPc_ConnCloseHook(HTTPc_CONN_OBJ  *p_conn_obj,
                                    CPU_BOOLEAN      close_status,
                                    HTTPc_ERR        err);


Arguments

p_conn_obj

Pointer to the current HTTPc Connection Object.

...

Notes / Warnings

None.

Example Template

Code Block
languagecpp
titleListing - Connection Close Hook Function Example Code
linenumberstrue
static void  HTTPc_ConnCloseHook (HTTPc_CONN_OBJ  *p_conn,
                                  CPU_BOOLEAN      close_status,
                                  HTTPc_ERR        err)
{
	printf("Connection closed with error code %i.\n\r", err);
}