|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Layer 4 (Transport) - the active OPEN: the outbound client transport. More...
#include "protocore_config.h"Go to the source code of this file.
Layer 4 (Transport) - the active OPEN: the outbound client transport.
RFC 9293 sec 3.9.1.1 gives OPEN an active/passive flag; this is the active side, the dialing peer of the passive OPEN in server.h.
A small fixed pool of outbound connections so the application's clients (services/net/http_client, services/iot/mqtt, services/net/ws_client) no longer each own a private raw stack at L7. As with the server transport, every raw stack call is marshaled into the stack's own context (see lower.h), so the main-loop/worker task never races it. All storage is static (no heap).
The receive ring carries wire bytes: for a plaintext connection those are the application bytes; for a TLS connection they are ciphertext and the caller carries plaintext octets: there is no client-side TLS engine in the library, so nothing BIO at protocore_client_send() / protocore_client_read().
Nothing here blocks. open() takes a slot, starts the resolve and returns a cid straight away; the slot carries its own timer and steps from resolving to connected each time the caller asks connected() or is_closed(). The caller drives that from its own loop, and the whole open - the name lookup included - is bounded by the timeout_ms it passed.
Definition in file client.h.