unilink is a modern C++17 library that provides a unified, high-level Builder API for TCP (client/server) and Serial port communication. It simplifies network and serial programming with a fluent, easy-to-use interface that handles all the complexity behind the scenes.
- π Unified API - Single interface for TCP (Client/Server) and Serial communication
- π Automatic Reconnection - Built-in, configurable reconnection logic
- π§΅ Thread-Safe - All operations are thread-safe with managed I/O threads
- π‘οΈ Memory Safety - Comprehensive bounds checking, leak detection, and safe data handling
- β‘ High Performance - Asynchronous I/O with callback-based non-blocking operations
- π― Modern C++17 - Clean, fluent Builder API with optional configuration management
- β Well-Tested - 72.2% test coverage with comprehensive unit, integration, and E2E tests
- π CI/CD Ready - Automated testing on Ubuntu 22.04 and 24.04 with build verification for Ubuntu 20.04
#include "unilink/unilink.hpp"
int main() {
// Create a TCP client - it's that simple!
auto client = unilink::tcp_client("127.0.0.1", 8080)
.on_connect([]() { std::cout << "Connected!" << std::endl; })
.on_data([](const std::string& data) { std::cout << "Received: " << data << std::endl; })
.build();
client->start();
client->send("Hello, Server!");
std::this_thread::sleep_for(std::chrono::seconds(5));
client->stop();
}# In your CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
project(my_app CXX)
find_package(unilink CONFIG REQUIRED)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE unilink::unilink)#include <unilink/unilink.hpp>
int main() {
auto client = unilink::tcp_client("127.0.0.1", 8080).build();
// ...
}# Install dependencies (Ubuntu/Debian)
sudo apt update && sudo apt install -y build-essential cmake libboost-dev libboost-system-dev
# Build and install
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
sudo cmake --install build
# Use in your project
find_package(unilink CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE unilink::unilink)# Download and extract the package for your OS/arch
# File pattern: unilink-<version>-<OS>-<arch>.<ext>
# Linux (tar.gz)
curl -LO https://github.com/jwsung91/unilink/releases/latest/download/unilink-0.1.6-Linux-x86_64.tar.gz
tar -xzf unilink-0.1.6-Linux-x86_64.tar.gz
# macOS (tar.gz; .dmg also available in Releases)
curl -LO https://github.com/jwsung91/unilink/releases/latest/download/unilink-0.1.6-Darwin-arm64.tar.gz
tar -xzf unilink-0.1.6-Darwin-arm64.tar.gz
# Windows (zip)
curl -LO https://github.com/jwsung91/unilink/releases/latest/download/unilink-0.1.6-Windows-AMD64.zip
unzip unilink-0.1.6-Windows-AMD64.zipFor detailed installation instructions, see Installation Guide.
# Option A: Visual Studio generator (x64)
cmake -S . -B build-windows `
-G "Visual Studio 17 2022" -A x64 `
-DUNILINK_BUILD_TESTS=ON
cmake --build build-windows --config Release
ctest --test-dir build-windows -C Release --output-on-failure
# Option B: Ninja + vcpkg toolchain (example)
Remove-Item build-windows -Recurse -Force
cmake -S . -B build-windows -G "Ninja" `
-DCMAKE_TOOLCHAIN_FILE="F:/lib/vcpkg/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DUNILINK_BUILD_SHARED=ON
cmake --build build-windows --config Debug
ctest --test-dir build-windows --output-on-failure
# Run an example (DLL is copied automatically after re-configure)
.\build-windows\Release\echo_tcp_server.exe 8080Windows notes
- Re-run CMake (or start from a clean build directory) after pulling the latest branch so that example targets pick up the new post-build copy step for
unilink.dll. - Serial port recovery scenarios are Unix-only and are skipped automatically on Windows test runs.
- Async logging performance expectations are slightly lower on Windows (β₯50k messages/sec) to account for timer granularity and scheduler differences.
- Ubuntu 22.04 & 24.04: Full test suite with GCC 11/13 and Clang 14/15
- Memory Safety: AddressSanitizer, ThreadSanitizer, and Valgrind integration
- Performance: Automated regression testing and benchmarking
| Platform | Compiler | Status |
|---|---|---|
| Ubuntu 22.04 | GCC 11, Clang 14 | β Full Testing |
| Ubuntu 24.04 | GCC 13, Clang 15 | β Full Testing |
Ubuntu 20.04 Support:
- Ubuntu 20.04 reaches end-of-life in April 2025
- GitHub Actions Ubuntu 20.04 runners are being phased out
- You can still build and test locally on Ubuntu 20.04
- Consider upgrading to Ubuntu 22.04+ for full CI/CD support
- Quick Start Guide - Get up and running in 5 minutes
- Installation Guide - CMake package, source build, and release packages
- Build Guide - Detailed build instructions and options
- Requirements - System requirements and dependencies
- Runtime Behavior - Threading model, reconnection policies, backpressure
- Memory Safety - Safety features and guarantees
- System Overview - High-level architecture
- API Reference - Comprehensive API documentation
- Performance Optimization - Build configurations and optimization
- Testing Guide - Running tests and CI/CD integration
- Best Practices - Recommended patterns and usage
- Troubleshooting - Common issues and solutions
- Release Notes - Version history and migration guides
- TCP Examples - Client/Server examples
- Serial Examples - Serial port communication
- Tutorials - Step-by-step learning guides
- Documentation Index - Complete documentation overview
- Conan recipe lives in
packaging/conan(runconan create packaging/conan unilink/0.1.6@; updateconandata.ymlSHA before tagging). - vcpkg overlay port lives in
packaging/vcpkg/ports/unilink(usevcpkg install unilink --overlay-ports=packaging/vcpkg/portsfor local tests). - Local test commands (run from repo root):
# Conan (v2): build & test the recipe conan create packaging/conan --name=unilink --version=0.1.6 # vcpkg: install using the local overlay port vcpkg install unilink --overlay-ports=packaging/vcpkg/ports
unilink is released under the Apache License, Version 2.0, which allows commercial use, modification, distribution, and patent use.
Copyright Β© 2025 Jinwoo Sung
This project was independently developed by Jinwoo Sung and is not affiliated with any employer.
Please note that some third-party dependencies use different licenses:
- Boost (Boost Software License 1.0) - Permissive, compatible with Apache 2.0
For full license details and attribution requirements, see the LICENSE and NOTICE files.
Built with β€οΈ using Modern C++17 and Boost.Asio