TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
Loading...
Searching...
No Matches
tec_socket_client.hpp File Reference

Definition of the SocketClient class template. More...

#include <cstddef>
#include <cerrno>
#include <cstdlib>
#include <vector>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include "tec/tec_def.hpp"
#include "tec/tec_trace.hpp"
#include "tec/tec_status.hpp"
#include "tec/tec_message.hpp"
#include "tec/tec_actor.hpp"
#include "tec/tec_memfile.hpp"
#include "tec/net/tec_socket.hpp"

Go to the source code of this file.

Classes

class  tec::SocketClient< TParams >
 Templated client socket actor for establishing and managing connections. More...
 

Macros

#define _POSIX_C_SOURCE   200809L
 

Detailed Description

Definition of the SocketClient class template.

This file contains the implementation of the SocketClient class, which is a templated actor-based client for socket communications. It handles connection establishment, data transmission (especially string-based), and lifecycle management. The class uses a parameter template to allow customization while ensuring derivation from SocketClientParams via static assertion.

The SocketClient supports raw character stream processing and is extensible for other data types (e.g., NetData in separate headers). It leverages system calls for socket operations and provides virtual hooks for customization, such as setting socket options or overriding send/receive behavior.

Note
This class is part of the TEC library namespace and inherits from Actor for asynchronous or threaded operation integration.
Author
The Emacs Cat
Date
2025-12-02