|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Layer 4 outbound TCP client transport (pooled). See client.h. More...
#include "client.h"Go to the source code of this file.
Functions | |
| int | pc_client_open (const char *, uint16_t, uint32_t) |
Resolve host (dotted-quad fast path, else DNS) and connect to host : port, blocking up to timeout_ms. | |
| bool | pc_client_connected (int) |
True once the TCP handshake has completed for cid. | |
| bool | pc_client_is_closed (int) |
| True once the peer closed (FIN) or the connection errored. | |
| bool | pc_client_send (int, const void *, size_t) |
Queue len wire bytes for transmission (marshaled tcp_write + output). | |
| size_t | pc_client_available (int) |
| Wire bytes currently buffered and ready to read. | |
| size_t | pc_client_read (int, uint8_t *, size_t) |
Drain up to cap buffered wire bytes into buf; returns the count. | |
| void | pc_client_close (int) |
| Tear down the connection (marshaled) and return the slot to the pool. | |
Layer 4 outbound TCP client transport (pooled). See client.h.
Mirrors the server transport's cross-thread rule: every raw lwIP call runs in tcpip_thread via tcpip_api_call(). Each slot owns its pcb and an SPSC wire ring (producer = the lwIP recv callback in tcpip_thread; consumer = the caller's loop/blocking task). The rings use volatile indices, matching the shipped per-client implementations this consolidates.
Definition in file client.cpp.
| int pc_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 354 of file client.cpp.
| bool pc_client_connected | ( | int | cid | ) |
True once the TCP handshake has completed for cid.
Definition at line 358 of file client.cpp.
| bool pc_client_is_closed | ( | int | cid | ) |
True once the peer closed (FIN) or the connection errored.
Definition at line 362 of file client.cpp.
| bool pc_client_send | ( | int | cid, |
| const void * | data, | ||
| size_t | len | ||
| ) |
Queue len wire bytes for transmission (marshaled tcp_write + output).
Definition at line 366 of file client.cpp.
| size_t pc_client_available | ( | int | cid | ) |
Wire bytes currently buffered and ready to read.
Definition at line 370 of file client.cpp.
| size_t pc_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 374 of file client.cpp.
| void pc_client_close | ( | int | cid | ) |
Tear down the connection (marshaled) and return the slot to the pool.
Definition at line 378 of file client.cpp.