DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
sockpool.h File Reference

Dynamic socket recycling: an LRU connection-slot pool (DETWS_ENABLE_SOCKPOOL). More...

#include "ServerConfig.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Dynamic socket recycling: an LRU connection-slot pool (DETWS_ENABLE_SOCKPOOL).

A device serves a bounded number of concurrent connections. When the pool saturates, the right move is not to drop the new connection but to recycle the least-recently-active slot (the one most likely to be a dead / idle keep-alive) and hand it to the new peer, returning the evicted id so the transport can close it cleanly. This is the transport-pool half left open by services/netadapt.

This is that pure policy: a fixed table of connection slots (each an id + last-used tick), with acquire (free slot, else LRU-recycle), touch (mark active), release, and find. The app owns the real sockets; this owns which slot a connection lives in and which to reclaim under pressure. No heap, no stdlib, host-testable.

Definition in file sockpool.h.