ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
Listener Struct Reference

State for one TCP listening port. More...

#include <common.h>

Public Attributes

uint16_t port
 TCP port this listener binds.
 
ProtoConn proto
 Application protocol for all connections accepted here.
 
protocore_pcb * listen_pcb
 the listening control block; NULL when inactive.
 
proto_bool active
 True after listener_add(), false after listener_stop().
 
proto_bool tls
 True when connections accepted here begin a TLS handshake.
 
uint8_t dscp
 Per-listener DiffServ DSCP for accepted connections; PROTOCORE_DSCP_UNSET = use the default.
 

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(protocore_pcb*) + sizeof(protocore_platform_queue_ctrl) + EVT_QUEUE_DEPTH*sizeof(TcpEvt)

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

Definition at line 137 of file common.h.

Member Data Documentation

◆ port

uint16_t Listener::port

TCP port this listener binds.

Definition at line 139 of file common.h.

◆ proto

ProtoConn Listener::proto

Application protocol for all connections accepted here.

Definition at line 140 of file common.h.

◆ listen_pcb

protocore_pcb* Listener::listen_pcb

the listening control block; NULL when inactive.

Definition at line 141 of file common.h.

◆ active

proto_bool Listener::active

True after listener_add(), false after listener_stop().

Definition at line 149 of file common.h.

◆ tls

proto_bool Listener::tls

True when connections accepted here begin a TLS handshake.

Definition at line 150 of file common.h.

◆ dscp

uint8_t Listener::dscp

Per-listener DiffServ DSCP for accepted connections; PROTOCORE_DSCP_UNSET = use the default.

Definition at line 151 of file common.h.


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