|
unilink
0.4.3
A simple C++ library for unified async communication
|
Namespaces | |
| base | |
| builder | |
| common | |
| concurrency | |
| config | |
| diagnostics | |
| factory | |
| framer | |
| interface | |
| memory | |
| transport | |
| util | |
| wrapper | |
Classes | |
| struct | ReconnectDecision |
| Represents a decision on whether to retry a connection attempt. More... | |
Typedefs | |
| using | ReconnectPolicy = std::function< ReconnectDecision(const diagnostics::ErrorInfo &, uint32_t)> |
| Function type for determining reconnection policy. More... | |
| using | TcpClient = wrapper::TcpClient |
| using | TcpServer = wrapper::TcpServer |
| using | Serial = wrapper::Serial |
| using | Udp = wrapper::Udp |
| using | MessageContext = wrapper::MessageContext |
| using | ConnectionContext = wrapper::ConnectionContext |
| using | ErrorContext = wrapper::ErrorContext |
Enumerations | |
| enum class | ErrorCode { Success = 0 , Unknown , InvalidConfiguration , InternalError , IoError , ConnectionRefused , ConnectionReset , ConnectionAborted , TimedOut , NotConnected , AlreadyConnected , PortInUse , AccessDenied , Stopped , StartFailed } |
| Structured error codes for Unilink. More... | |
Functions | |
| std::string | to_string (ErrorCode code) |
| Convert ErrorCode to human-readable string. More... | |
| ReconnectPolicy | FixedInterval (std::chrono::milliseconds delay) |
| Creates a policy that retries with a fixed interval. More... | |
| ReconnectPolicy | ExponentialBackoff (std::chrono::milliseconds min_delay, std::chrono::milliseconds max_delay, double factor=2.0, bool jitter=true) |
| Creates a policy that retries with exponential backoff. More... | |
| builder::TcpServerBuilder | tcp_server (uint16_t port) |
| Create a TCP server builder. More... | |
| builder::TcpClientBuilder | tcp_client (const std::string &host, uint16_t port) |
| Create a TCP client builder. More... | |
| builder::SerialBuilder | serial (const std::string &device, uint32_t baud_rate) |
| Create a Serial port builder. More... | |
| builder::UdpBuilder | udp (uint16_t local_port) |
| Create a UDP builder. More... | |
| using unilink::ConnectionContext = typedef wrapper::ConnectionContext |
Definition at line 93 of file unilink.hpp.
| using unilink::ErrorContext = typedef wrapper::ErrorContext |
Definition at line 94 of file unilink.hpp.
| using unilink::MessageContext = typedef wrapper::MessageContext |
Definition at line 92 of file unilink.hpp.
| using unilink::ReconnectPolicy = typedef std::function<ReconnectDecision(const diagnostics::ErrorInfo&, uint32_t)> |
Function type for determining reconnection policy.
Accepts the last error information and the current attempt count (0-based). Returns a ReconnectDecision.
Definition at line 46 of file reconnect_policy.hpp.
| using unilink::Serial = typedef wrapper::Serial |
Definition at line 88 of file unilink.hpp.
| using unilink::TcpClient = typedef wrapper::TcpClient |
Definition at line 86 of file unilink.hpp.
| using unilink::TcpServer = typedef wrapper::TcpServer |
Definition at line 87 of file unilink.hpp.
| using unilink::Udp = typedef wrapper::Udp |
Definition at line 89 of file unilink.hpp.
|
strong |
Structured error codes for Unilink.
Definition at line 26 of file error_codes.hpp.
|
inline |
Creates a policy that retries with exponential backoff.
| min_delay | The initial delay. |
| max_delay | The maximum delay cap. |
| factor | The multiplier for each retry (default 2.0). |
| jitter | Whether to add randomization to the delay (default true). |
Definition at line 72 of file reconnect_policy.hpp.
|
inline |
Creates a policy that retries with a fixed interval.
| delay | The delay between retries. |
Definition at line 54 of file reconnect_policy.hpp.
|
inline |
Create a Serial port builder.
| device | The serial device path (e.g., "/dev/ttyUSB0") |
| baud_rate | The baud rate for serial communication |
Definition at line 121 of file unilink.hpp.
|
inline |
Create a TCP client builder.
| host | The host address to connect to |
| port | The port number to connect to |
Definition at line 111 of file unilink.hpp.
|
inline |
Create a TCP server builder.
| port | The port number for the server |
Definition at line 103 of file unilink.hpp.
|
inline |
Convert ErrorCode to human-readable string.
Definition at line 53 of file error_codes.hpp.
|
inline |
Create a UDP builder.
| local_port | The local port to bind |
Definition at line 130 of file unilink.hpp.