Task Configuration

HTTP_TASK_CFG

µC/HTTP-sever has a separated structure for the task configuration of the HTTP server Instance. The structure defines the task priority, the stack size and the stack memory location. Like the HTTPs_CFG object, the HTTP_TASK_CFG object must be passed to the HTTPs_InstanceInit API function during the initialization of the HTTP server instance.

Structure Fields

HTTPs Instance Task Configuration Structure
const  HTTP_TASK_CFG  HTTPs_TaskCfgInstance = {
    HTTPs_OS_CFG_INSTANCE_TASK_PRIO,        /* .Prio                                */
    HTTPs_OS_CFG_INSTANCE_TASK_STK_SIZE,    /* .StkSizeBytes                        */
    DEF_NULL,                               /* .StkPtr                              */
};

Configuration Fields Description

Table - Task Configuration
Structure FieldTypeDescriptionPossible Values

Prio

CPU_INT32U

Configure Instance Task priority.

We recommend to configure the Network Protocol Stack task priorities & HTTP server Instances  tasks priorities as follows:

  • NET_OS_CFG_IF_TX_DEALLOC_TASK_PRIO (Highest)
  • HTTPs_OS_CFG_INSTANCE_TASK_PRIO    (  ...  )
  • NET_OS_CFG_TMR_TASK_PRIO           (  ...  ) 
  • NET_OS_CFG_IF_RX_TASK_PRIO         (Lowest )

We recommend that the uC/TCP-IP Timer task and network interface Receive task be lower priority than almost all other application tasks; but we recommend that the network interface Transmit De-allocation task be higher priority than all application tasks that use uC/TCP-IP network services.

However better performance can be observed when the web server instance is set with the lowest priority. So some experimentation could be required to identify the better task priority configuration.

SHOULD be >= than the minimum priority number allowed by the OS. 
StkSizeBytesCPU_INT32U

Configure HTTP server instance task stack size.

SHOULD be >= than the minimum stack size allowed by the OS.
StkPtrvoid*Pointer to base of the stack.

When the Stack pointer is defined as null pointer (DEF_NULL), the task's stack should be automatically allowed on the heap of uC/LIB.

SHOULD be a Memory pointer
or
DEF_NULL