1#ifndef DAQ_TCP_CLIENT_HPP
2#define DAQ_TCP_CLIENT_HPP
33 bool connect(
const std::string& host, uint16_t
port);
51 bool write_all(
const void* data,
size_t len);
72 ssize_t
read(
void* buffer,
size_t max_len);
104 bool _write_all(
const void* data,
size_t len);
void flush()
Flush buffered data.
static constexpr size_t BUFFER_SIZE
std::vector< uint8_t > write_buffer_
ssize_t read(void *buffer, size_t max_len)
Read data from socket (non-blocking).
void disconnect()
Disconnect from server.
void set_recv_timeout_ms(int timeout_ms)
Set socket receive timeout (0 = blocking).
bool _write_all(const void *data, size_t len)
bool write_all(const void *data, size_t len)
Write data directly (for VTable registration).
bool read_exact(void *buffer, size_t len)
Read exactly len bytes (blocking).
bool connect(const std::string &host, uint16_t port)
Connect to TCP server.
bool write_buffered(const void *data, size_t len)
Write data with buffering (for data publishing).
std::string last_error() const
Get last error message.
bool is_connected() const
Check if connected.
static const emmc_port_t port