ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
coaps_server.h File Reference

The CoAP-over-DTLS server: a bound UDP port, a pool of DTLS connections, and the bridge. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

The CoAP-over-DTLS server: a bound UDP port, a pool of DTLS connections, and the bridge.

The socket half of Coaps. It owns a fixed pool of DTLS 1.3 connections, binds the secured CoAP port (RFC 7252 sec 12.7 registers 5684 and the service name "coaps"; sec 6.2 gives it the "coaps" URI scheme), routes each inbound datagram to the connection for its peer, drives the handshake and its retransmission timer (RFC 9147 sec 5.8), and hands established application records to Coaps. Resources are registered once through Coap, so a plaintext server on 5683 and this secured one serve the same table.

The receive side and the connections run in different contexts: the transport delivers datagrams as they arrive, so the receive path only copies each into a single-producer ingest ring, and the poll drains that ring, runs the bridge, fires the retransmission timer, and reclaims connections that failed or went quiet. The handshake engines therefore only ever run where the poll runs. Where the build has no network stack there is no receive path: datagrams go in through ingest and replies come out through the sink, which is what makes the whole server host-testable by shuttling buffers to an in-test DTLS client.

Raise PROTOCORE_COAPS_MAX_CONNS for more simultaneous peers; each slot is one handshake engine plus its per-connection key material.

The module exports one symbol, CoapsServer. Everything in coaps_server.c has internal linkage.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file coaps_server.h.