48#ifndef _POSIX_C_SOURCE
49#define _POSIX_C_SOURCE 200809L
57#include <sys/socket.h>
95template <
typename TParams>
133 TEC_ENTER(
"SocketClientNd::process_request");
137 if (!request.has_value() || !reply.has_value()) {
142 if (req->nd ==
nullptr || rep->nd ==
nullptr) {
219 this->params_.compression_level,
220 this->params_.compression_min_size);
234 this->params_.compression_level,
235 this->params_.compression_min_size);
281 TEC_ENTER(
"SocketClientNd::send_recv_nd");
virtual Status terminate()
Mimics Daemon's behavior.
Definition tec_actor.hpp:183
Compression wrapper for NetData objects with pluggable backends.
Definition tec_nd_compress.hpp:89
virtual Status compress(NetData &nd) const
Compresses the payload of a NetData object in-place (if configured)
Definition tec_nd_compress.hpp:161
virtual Status uncompress(NetData &nd) const
Decompresses the payload of a NetData object in-place (if compressed)
Definition tec_nd_compress.hpp:202
Lightweight binary serialization container optimized for network communication.
Definition tec_net_data.hpp:51
void rewind()
Resets read position to the beginning of the buffer.
Definition tec_net_data.hpp:119
Templated client socket actor for NetData stream handling.
Definition tec_socket_client_nd.hpp:96
virtual Status send_nd(NetData *nd)
Sends a NetData object over the socket.
Definition tec_socket_client_nd.hpp:177
virtual ~SocketClientNd()=default
Default destructor.
SocketClientNd(const Params ¶ms)
Constructs a SocketClientNd with the given parameters.
Definition tec_socket_client_nd.hpp:109
TParams Params
Type alias for the template parameter TParams. This allows easy reference to the params type within t...
Definition tec_socket_client_nd.hpp:100
virtual Status recv_nd(NetData *nd)
Receives a NetData object from the socket.
Definition tec_socket_client_nd.hpp:193
Status process_request(Request request, Reply reply) override
Processes incoming requests, handling NetData types.
Definition tec_socket_client_nd.hpp:132
Status request_nd(NetData *nd_in, NetData *nd_out)
Convenience method to send a NetData request and receive a response.
Definition tec_socket_client_nd.hpp:161
virtual Status uncompress(NetData *nd)
Uncompresses the NetData using configured parameters.
Definition tec_socket_client_nd.hpp:232
virtual Status postprocess(NetData *nd)
Postprocesses the NetData after receiving (default: uncompress).
Definition tec_socket_client_nd.hpp:259
virtual Status send_recv_nd(NetData *nd_in, NetData *nd_out)
Sends a NetData request and receives a reply with pre/postprocessing.
Definition tec_socket_client_nd.hpp:280
virtual Status preprocess(NetData *nd)
Preprocesses the NetData before sending (default: compress).
Definition tec_socket_client_nd.hpp:247
virtual Status compress(NetData *nd)
Compresses the NetData using configured parameters.
Definition tec_socket_client_nd.hpp:217
Templated client socket actor for establishing and managing connections.
Definition tec_socket_client.hpp:92
constexpr size_t get_buffer_size()
Returns the size of the internal buffer.
Definition tec_socket_client.hpp:122
constexpr char * get_buffer()
Returns a pointer to the internal buffer.
Definition tec_socket_client.hpp:116
Params params_
Instance of the parameters used for configuration. This holds settings like address,...
Definition tec_socket_client.hpp:106
int sockfd_
Socket file descriptor for the established connection. Initialized to EOF (-1) and set upon successfu...
Definition tec_socket_client.hpp:110
Status process_request(Request request, Reply reply) override
Processes incoming requests, handling SocketCharStreamIn types.
Definition tec_socket_client.hpp:256
#define TEC_ENTER(name)
Logs an entry message for a named context (e.g., function).
Definition tec_trace.hpp:211
@ Invalid
Invalid data or state.
Helper type for ADL customization of input operations.
Definition tec_net_data.hpp:478
Helper type for ADL customization of output operations.
Definition tec_net_data.hpp:493
Specialized socket wrapper optimized for sending/receiving NetData protocol messages.
Definition tec_socket_nd.hpp:63
static Status send_nd(const NetData *nd, const SocketNd *sock)
Sends a complete NetData message (header + payload) over the socket.
Definition tec_socket_nd.hpp:96
static Status recv_nd(NetData *nd, const SocketNd *sock)
Receives one complete NetData message (header + payload)
Definition tec_socket_nd.hpp:148
char addr[INET6_ADDRSTRLEN]
Peer address as a null-terminated string (IPv4 or IPv6).
Definition tec_socket.hpp:274
Common definitions and utilities for the tec namespace.
Defines a flexible message type and helper functions for the tec namespace.
std::any Reply
Type alias for a reply object that can hold any object.
Definition tec_message.hpp:55
std::any Request
Type alias for a request object that can hold any object.
Definition tec_message.hpp:49
Compression wrapper for NetData objects with pluggable backends.
Lightweight binary serialization optimized for network communication.
Definition of the SocketClient class template.
NetData BSD socket operations.
Defines error handling types and utilities for the tec namespace.
Provides a thread-safe tracing utility for debugging in the tec namespace.