|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Layer 4 outbound TCP client transport - the client-side peer of the (server) transport in tcp.cpp. More...
Go to the source code of this file.
Functions | |
| int | det_client_open (const char *host, uint16_t port, uint32_t timeout_ms) |
Resolve host (dotted-quad fast path, else DNS) and connect to host : port, blocking up to timeout_ms. | |
| bool | det_client_connected (int cid) |
True once the TCP handshake has completed for cid. | |
| bool | det_client_is_closed (int cid) |
| True once the peer closed (FIN) or the connection errored. | |
| bool | det_client_send (int cid, const void *data, size_t len) |
Queue len wire bytes for transmission (marshaled tcp_write + output). | |
| size_t | det_client_available (int cid) |
| Wire bytes currently buffered and ready to read. | |
| size_t | det_client_read (int cid, uint8_t *buf, size_t cap) |
Drain up to cap buffered wire bytes into buf; returns the count. | |
| void | det_client_close (int cid) |
| Tear down the connection (marshaled) and return the slot to the pool. | |
Layer 4 outbound TCP client transport - the client-side peer of the (server) transport in tcp.cpp.
A small fixed pool of outbound connections so the application's clients (services/http_client, services/mqtt, services/ws_client) no longer each own a private raw-lwIP TCP stack at L7. As with the server transport, every raw tcp_*() call is marshaled into tcpip_thread via tcpip_api_call(), so the main-loop/worker task never races the stack. 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 layers the shared client-TLS session (det_tls_csess_*) on top, pointing its BIO at det_client_send() / det_client_read().
The core is non-blocking (read/available/send), so it suits both a polling client loop (MQTT, WebSocket) and a blocking request (HTTP) that drives its own deadline. Only det_client_open() blocks, on DNS + connect.
Definition in file client.h.
| int det_client_open | ( | const char * | host, |
| uint16_t | port, | ||
| uint32_t | timeout_ms | ||
| ) |
Resolve host (dotted-quad fast path, else DNS) and connect to host : port, blocking up to timeout_ms.
Definition at line 310 of file client.cpp.
| bool det_client_connected | ( | int | cid | ) |
True once the TCP handshake has completed for cid.
Definition at line 314 of file client.cpp.
| bool det_client_is_closed | ( | int | cid | ) |
True once the peer closed (FIN) or the connection errored.
Definition at line 318 of file client.cpp.
| bool det_client_send | ( | int | cid, |
| const void * | data, | ||
| size_t | len | ||
| ) |
Queue len wire bytes for transmission (marshaled tcp_write + output).
Definition at line 322 of file client.cpp.
| size_t det_client_available | ( | int | cid | ) |
Wire bytes currently buffered and ready to read.
Definition at line 326 of file client.cpp.
| size_t det_client_read | ( | int | cid, |
| uint8_t * | buf, | ||
| size_t | cap | ||
| ) |
Drain up to cap buffered wire bytes into buf; returns the count.
Definition at line 330 of file client.cpp.
| void det_client_close | ( | int | cid | ) |
Tear down the connection (marshaled) and return the slot to the pool.
Definition at line 334 of file client.cpp.