3#ifndef PROTOCORE_CLIENT_H
4#define PROTOCORE_CLIENT_H
37int pc_client_open(
const char *host, uint16_t port, uint32_t timeout_ms);
bool pc_client_is_closed(int cid)
True once the peer closed (FIN) or the connection errored.
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.
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.
void pc_client_close(int cid)
Tear down the connection (marshaled) and return the slot to the pool.
bool pc_client_send(int cid, const void *data, size_t len)
Queue len wire bytes for transmission (marshaled tcp_write + output).
bool pc_client_connected(int cid)
True once the TCP handshake has completed for cid.
size_t pc_client_available(int cid)
Wire bytes currently buffered and ready to read.
User-facing configuration for ProtoCore.