Connection Close

This hook function, if defined, is called every time a connection is closed to notify the upper application to release resource allocated related to an HTTP connection, as shown in the figure Hook Functions..

Prototype

void  HTTPs_ConnCloseHook (const  HTTPs_INSTANCE  *p_instance,
                                  HTTPs_CONN      *p_conn,
                           const  void            *p_hook_cfg);

Arguments

p_instance

Pointer to the instance structure (read only).

p_conn

Pointer to the connection structure.

p_hook_cfg

Pointer to hook application data.

Return Values

None.

Required Configuration

See Hook Configuration.

Notes / Warnings

  • The instance structure is for read-only. It must not be modified.
  • The connection structure is read-only since the connection will be freed after this call.
  • ConnDataPtr parameter should be used to store the location of the data allocated.

Example Template

The listing below is shown to demonstrate the µC/HTTP-server module capabilities. That code simply print that the connection is closing.

Listing - Connection Close Hook Example Code
static  void  HTTPs_ConnCloseHook (const  HTTPs_INSTANCE  *p_instance,
                                          HTTPs_CONN      *p_conn,
                                   const  void            *p_hook_cfg)
{
	printf("Connection is closing.\n\r");
}