DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
Listener Struct Reference

State for one TCP listening port. More...

#include <listener.h>

Public Attributes

uint16_t port
 TCP port this listener binds.
 
ConnProto proto
 Application protocol for all connections accepted here.
 
struct tcp_pcb * listen_pcb
 lwIP listen PCB; nullptr when inactive.
 
StaticQueue_t _queue_struct
 FreeRTOS static queue descriptor.
 
uint8_t _queue_storage [EVT_QUEUE_DEPTH *sizeof(TcpEvt)]
 Queue backing store.
 
QueueHandle_t queue
 Handle returned by xQueueCreateStatic().
 
bool active
 True after listener_add(), false after listener_stop().
 
bool tls
 True when connections accepted here begin a TLS handshake.
 

Detailed Description

State for one TCP listening port.

All queue storage is embedded in this struct so the entire listener pool lives in BSS - no heap allocation anywhere in the listener layer.

A single Listener instance consumes: sizeof(tcp_pcb*) + sizeof(StaticQueue_t) + EVT_QUEUE_DEPTH*sizeof(TcpEvt)

  • sizeof(QueueHandle_t) + 3 bytes overhead (port, proto, active).

Definition at line 54 of file listener.h.

Member Data Documentation

◆ port

uint16_t Listener::port

TCP port this listener binds.

Definition at line 56 of file listener.h.

Referenced by listener_add(), and listener_add_dynamic().

◆ proto

ConnProto Listener::proto

Application protocol for all connections accepted here.

Definition at line 57 of file listener.h.

Referenced by listener_add(), and listener_add_dynamic().

◆ listen_pcb

struct tcp_pcb* Listener::listen_pcb

lwIP listen PCB; nullptr when inactive.

Definition at line 58 of file listener.h.

Referenced by listener_add(), listener_add_dynamic(), listener_stop(), and listener_stop_dynamic().

◆ _queue_struct

StaticQueue_t Listener::_queue_struct

FreeRTOS static queue descriptor.

Definition at line 59 of file listener.h.

Referenced by listener_add(), and listener_add_dynamic().

◆ _queue_storage

uint8_t Listener::_queue_storage[EVT_QUEUE_DEPTH *sizeof(TcpEvt)]

Queue backing store.

Definition at line 60 of file listener.h.

Referenced by listener_add(), and listener_add_dynamic().

◆ queue

QueueHandle_t Listener::queue

Handle returned by xQueueCreateStatic().

Definition at line 61 of file listener.h.

Referenced by listener_add(), listener_add_dynamic(), listener_enqueue(), listener_stop(), listener_stop_dynamic(), and server_tick().

◆ active

bool Listener::active

◆ tls

bool Listener::tls

True when connections accepted here begin a TLS handshake.

Definition at line 63 of file listener.h.

Referenced by listener_add(), and listener_add_dynamic().


The documentation for this struct was generated from the following file: