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

Layer 5 (Session) - where a connection is opened, closed and controlled. More...

Go to the source code of this file.

Classes

struct  ProtocolsVars
 
struct  ProtoRegistryNs
 The entries. More...
 
struct  SessionVars
 
struct  SessionNs
 The entries. More...
 

Typedefs

typedef proto_bool(* protocore_resp_sink_fn) (uint8_t slot, int code, const char *content_type, const char *body, size_t len)
 

Functions

void protocore_protocols_register_builtins (uint8_t *work)
 
void protocore_protocols_add (uint8_t *work)
 
void protocore_protocols_get (uint8_t *work)
 
void protocore_session_tick (uint8_t *work)
 
uint8_t * protocore_session_span (void)
 The PROTOCORE_SESSION_BORROW bytes this module's state lives in.
 

Variables

ProtocolsVars ProtocolsV
 The operands and the outcome.
 
uint32_t http_req_start_ms [CONN_POOL_SLOTS]
 
protocore_resp_sink_fn http_resp_sink [CONN_POOL_SLOTS]
 
SessionVars SessionV
 The operands and the outcome.
 

Detailed Description

Layer 5 (Session) - where a connection is opened, closed and controlled.

A connection's life is decided here: the transport signals that one arrived, ended or faulted, and this layer turns that into an open, a close, or a dispatch to whichever protocol owns the slot. It sits above the server core and uses it rather than being part of it - the worker pool turns the crank (server/core/worker.h) and the protocol registry says who receives the event (server/core/proto_handler.h).

One tick drains every pending event in a single bounded loop, so the worst case is O(queue_depth + MAX_CONNS) rather than unbounded in the arrival rate.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file session.h.

Typedef Documentation

◆ protocore_resp_sink_fn

typedef proto_bool(* protocore_resp_sink_fn) (uint8_t slot, int code, const char *content_type, const char *body, size_t len)

Definition at line 99 of file session.h.

Function Documentation

◆ protocore_protocols_register_builtins()

void protocore_protocols_register_builtins ( uint8_t *  work)

◆ protocore_protocols_add()

void protocore_protocols_add ( uint8_t *  work)

◆ protocore_protocols_get()

void protocore_protocols_get ( uint8_t *  work)

◆ protocore_session_tick()

void protocore_session_tick ( uint8_t *  work)

◆ protocore_session_span()

uint8_t * protocore_session_span ( void  )

The PROTOCORE_SESSION_BORROW bytes this module's state lives in.

Stated beside the namespace rather than on it: an entry takes a borrow, and this is where that borrow comes from. Taken once from the end of the pool, which no mark and no release walks, so the state lasts the life of the program.

Returns
the span.

Variable Documentation

◆ ProtocolsV

ProtocolsVars ProtocolsV
extern

The operands and the outcome.

◆ http_req_start_ms

uint32_t http_req_start_ms[CONN_POOL_SLOTS]
extern

◆ http_resp_sink

protocore_resp_sink_fn http_resp_sink[CONN_POOL_SLOTS]
extern

◆ SessionV

SessionVars SessionV
extern

The operands and the outcome.