What the stack callbacks post to a listener's queue: the event type and the record. More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | TcpEvt |
| Event record posted from the stack callbacks to the session layer. More... | |
Macros | |
| #define | PROTOCORE_OBS_TRANSITION(slot, olds, news, reason) |
| #define | PROTOCORE_OBS_NOTICE(slot, st, reason) |
Typedefs | |
| typedef struct TcpEvt | TcpEvt |
| Event record posted from the stack callbacks to the session layer. | |
Functions | |
| EMBED_ENUM_BYTE (ConnState, CONN_FREE, CONN_ACTIVE, CONN_CLOSING) | |
| Lifecycle state of a connection pool slot. | |
| EMBED_ENUM_BYTE (EvtType, EVT_CONNECT, EVT_DATA, EVT_DISCONNECT, EVT_ERROR) | |
| Type of connection event posted to a listener's event queue. | |
What the stack callbacks post to a listener's queue: the event type and the record.
Separate from common.h because this is all the layers above the transport need. A listener sizes its queue storage on TcpEvt, the session layer switches on ::EvtType, and the presentation layer names EVT_CONNECT. None of them touches a connection slot's fields. common.h carries those fields and their atomic words, and the sketches do not need them.
Definition in file evt.h.
| #define PROTOCORE_OBS_TRANSITION | ( | slot, | |
| olds, | |||
| news, | |||
| reason ) |
| #define PROTOCORE_OBS_NOTICE | ( | slot, | |
| st, | |||
| reason ) |
| typedef struct TcpEvt TcpEvt |
Event record posted from the stack callbacks to the session layer.
Copied into the queue by value, so nothing in it points at a slot whose lifetime ends before the record is drained.
| EMBED_ENUM_BYTE | ( | ConnState | , |
| CONN_FREE | , | ||
| CONN_ACTIVE | , | ||
| CONN_CLOSING | ) |
Lifecycle state of a connection pool slot.
NOT the RFC 9293 sec 3.3.2 connection state machine. That machine (LISTEN, SYN-RECEIVED, ESTABLISHED, FIN-WAIT-1/2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT) belongs to the stack under this layer; these three name only whether the pool slot is available. A test mapping CONN_* to RFC state names 1:1 is testing the wrong thing.
Transitions, as the code performs them:
Every terminal edge detaches the control block and frees the slot before handing it to the stack, so the slot's lifetime ends before the connection's does; the FIN and its retransmission are the stack's from that point (RFC 9293 sec 3.6).
Here rather than in common.h because the signaling layer reads a slot's state and reaches this layer through protocore.h. The enum is one packed byte.
| EMBED_ENUM_BYTE | ( | EvtType | , |
| EVT_CONNECT | , | ||
| EVT_DATA | , | ||
| EVT_DISCONNECT | , | ||
| EVT_ERROR | ) |
Type of connection event posted to a listener's event queue.
EVT_DISCONNECT and EVT_ERROR are the two a close is reported through, and they are distinct because RFC 9293 sec 3.6 MUST-12 requires the layer above to be told whether a connection closed normally or was aborted.