Acl (Advanced C/C++ Library) is a powerful cross-platform network communication library and server programming framework that supports Linux, Windows, Solaris, FreeBSD, macOS, Android, iOS, and HarmonyOS. Numerous applications developed with Acl run on various devices, providing stable and reliable services to hundreds of millions of users.
The Acl project includes a rich set of functional modules: network communication, server framework, application protocols, various codecs, and more. It has built-in implementations of common network protocols such as HTTP/SMTP/ICMP/MQTT/Redis/Memcached/Beanstalk/Handler Socket, as well as complete codec libraries including XML/JSON/MIME/BASE64/UUCODE/QPCODE/RFC2047/RFC1035, etc. Additionally, Acl provides a unified abstract interface for mainstream databases (MySQL, PostgreSQL, SQLite), enabling developers to write database applications more easily, quickly, and securely.
As a fully-featured C/C++ foundation library, Acl provides rich and practical functionality for application development. The six core modules include: Network Communication, Coroutine, HTTP, Redis Client, MQTT, and Server Framework.
Stream Processing Module
This module is the cornerstone of Acl's network communication, providing a unified streaming communication interface that supports both network streams and file streams. Main features include:
- Read data line by line, automatically compatible with
\r\non Windows and\non UNIX - Read data line by line with automatic removal of trailing newline characters (
\nor\r\n) - Read data with custom string delimiters
- Read data of specified length
- Try to read a line or specified length of data
- Detect network IO status
- Write a line of data
- Formatted data writing (similar to
fprintf) - File stream positioning operations (similar to
fseek) - Batch write data (similar to UNIX
writev) - Truncate files (similar to
ftruncate) - Get file size and current file stream pointer position (similar to
ftell) - Get local and remote addresses of network streams
Network Operation Module
This module provides complete network operation functionality, including:
- Network server listening (supports TCP/UDP/UNIX domain sockets)
- Network client connection (supports TCP/UNIX domain sockets)
- DNS domain name query and result caching (supports both system API calls and direct DNS protocol)
- Socket operations and local network interface information retrieval
Non-blocking Network Stream
Comprehensive support for non-blocking network operations, including non-blocking connections, reads (line reads, specified length reads), writes (line writes, specified length writes, batch writes), etc.
Common Network Application Protocol Library
Built-in implementations of common network application protocols such as HTTP, SMTP, ICMP, etc. The HTTP and ICMP modules support both blocking and non-blocking communication modes. The HTTP protocol in the C++ version of lib_acl_cpp provides both server and client modes:
- Server Mode: Provides a Java HttpServlet-like interface, supports Cookie, Session, HTTP MIME file upload, etc.
- Client Mode: Supports connection pool and cluster management, chunked transfer, automatic character set conversion, automatic decompression, resume download, and other rich features
Common Network Communication Library
Provides client communication libraries for Memcached, Beanstalk, Handler Socket, etc., all supporting connection pool mode.
Acl's coroutine module is a mature and stable cross-platform coroutine library that has been widely used and validated in many important projects.
Platform Support
- Supports mainstream operating systems including Linux, macOS, Windows, iOS, and Android
- Supports multiple CPU architectures including x86, ARM, etc.
- Supports multiple event engines including select/poll/epoll/kqueue/iocp/win32 GUI messages
Core Features
- Complete DNS Protocol Implementation: DNS protocol is natively implemented in coroutines, DNS API can be used directly in coroutines
- System API Hook: Automatically hooks system IO APIs on Unix and Windows platforms to enable coroutine support
- Read APIs: read/readv/recv/recvfrom/recvmsg
- Write APIs: write/writev/send/sendto/sendmsg/sendfile64
- Socket APIs: socket/listen/accept/connect/setsockopt
- Event APIs: select/poll/epoll_create/epoll_ctl/epoll_wait
- DNS APIs: gethostbyname/gethostbyname_r/getaddrinfo/freeaddrinfo
- Shared Stack Mode: Supports shared stack mode to significantly reduce memory usage
Synchronization Primitives
- Coroutine Mutex and Semaphore: For synchronization between coroutines
- Coroutine Event: Supports synchronous communication between coroutines and threads
For more details, see Using Acl Coroutine Library
Complete implementation of HTTP/1.1 protocol, supporting both client and server application development.
Main Features
- Java HttpServlet-like Interface (server side): Provides familiar programming interface, reducing learning curve
- Connection Pool Mode (client side): Efficiently manages connection resources, improves performance
- Chunked Transfer: Supports streaming data transfer
- Compression: Built-in Gzip compression/decompression support
- SSL/TLS Encryption: Supports secure encrypted transmission
- Resume Download: Supports resume download for large files
- Cookie Management: Complete cookie setting and retrieval functionality
- Session Management (server side): Built-in session management mechanism
- WebSocket Support: Supports WebSocket protocol
- HTTP MIME Format: Supports MIME multipart data format
- Sync/Async Mode: Flexible choice of communication modes
Acl's Redis client module is powerful, high-performance, and easy to use, making it an ideal choice for production environments.
Features
- Rich Command Support: Supports Redis data types and commands including Bitmap/String/Hash/List/Set/Sorted Set/PubSub/HyperLogLog/Geo/Script/Stream/Server/Cluster
- STL-style Interface: Provides STL-like C++ interface for each Redis command, conforming to C++ programming conventions
- Smart Cluster Management: Client automatically caches and adapts to changes in Redis cluster hash slots without manual intervention
- Multiple Communication Modes: Supports standalone, cluster, and pipeline modes with unified interface
- Connection Pool Support: Built-in connection pool supporting standalone and cluster modes, improving resource utilization
- High Performance: Excellent performance in cluster and pipeline modes
- Automatic Retry: Automatically retries on network errors, improving reliability
- Coroutine Friendly: Can be used in shared stack coroutine mode
For more details, see Using Acl Redis Client
Acl fully implements the MQTT 3.1.1 protocol with a streaming parser design that can flexibly adapt to various IO modes.
Core Features
- Complete MQTT 3.1.1 Protocol Support: Implements all standard commands
- CONNECT/CONNACK/PUBLISH/PUBACK/PUBREC/PUBREL/PUBCOMP
- SUBSCRIBE/SUBACK/UNSUBSCRIBE/UNSUBACK
- PINGREQ/PINGRESP/DISCONNECT
- Object-Oriented Design: Each MQTT command corresponds to an independent class with clear structure
- Streaming Parser: Independent of IO mode, can be combined with any network communication method
- Separation of Parsing and Communication: Data parsing is completely decoupled from network communication, providing high flexibility
- Dual-End Support: Can be used for both client and server development
For more details, see Using Acl MQTT
The server framework is the core module in Acl, helping developers quickly build high-performance backend services (such as web services). Through the code generation tool in app/wizard, a complete service code framework can be generated in seconds.
Architecture Design
The Acl server framework consists of two parts:
- Service Manager (acl_master): Derived from the famous Postfix MTA's master process, extensively extended to become a general-purpose service manager
- Service Templates: Provides multiple service templates for developers to choose from
Six Service Templates
-
Process Service Model
One connection per process.- Advantages: Simple programming, safe and stable
- Disadvantages: Limited concurrency
- Use Cases: High security requirements, low concurrency scenarios
-
Thread Service Model
Each process handles all client connections through a thread pool, using IO event triggering mechanism.- Advantages: Handle many connections with few threads, relatively simple programming
- Features: Threads are bound only when connections have data, released immediately after processing
- Use Cases: High concurrency scenarios, easier to develop than AIO model
-
AIO Service Model (Non-blocking)
Similar to Nginx/Squid/IRCd, single thread handles many connections in non-blocking IO mode.- Advantages: High processing efficiency, low resource consumption
- Disadvantages: Higher programming complexity
- Use Cases: Ultra-high concurrency, extreme performance requirements
-
Coroutine Service Model
Combines the high concurrency capability of non-blocking model with the simplicity of synchronous programming.- Advantages: High concurrency + low programming complexity, sequential IO programming style
- Features: Automatically converts blocking operations to non-blocking processes, improving concurrency
- Use Cases: Preferred choice for high concurrency scenarios, balancing performance and development efficiency
-
UDP Service Model
Service model specifically for UDP communication.- Use Cases: Applications requiring UDP protocol
-
Trigger Service Model
For handling scheduled tasks in background services (similar to system crontab).- Use Cases: Scheduled tasks, background scheduling
MIME (Multipurpose Internet Mail Extensions) is an important data format standard widely used in email and web applications.
Features
- Complete implementation of MIME-related RFC standards: RFC2045/RFC2047/RFC822
- Provides streaming MIME data parser independent of IO model
- Can be flexibly used in synchronous or asynchronous IO programs
- Supports MIME data parsing and construction
Acl provides rich codecs, all using streaming parsing design, independent of the IO communication layer.
Supported Codec Formats
- JSON: Streaming JSON parser and builder, supports serialization/deserialization between JSON data and C structures, greatly improving development efficiency
- XML: Streaming XML parser and builder
- Base64: Base64 encoding/decoding
- URL: URL encoding/decoding
- Others: UUCODE, QPCODE, RFC2047, etc.
Acl provides a unified database abstraction interface to simplify database application development.
Core Features
- Unified Interface: Provides unified operation interface for MySQL, PostgreSQL, SQLite
- SQL Security: Built-in SQL codec automatically escapes special characters, effectively preventing SQL injection attacks
- Dynamic Loading: Uses dynamic library loading, no need to worry about dependencies when not using database functionality
- Connection Pool Support: Built-in database connection pool management
Acl provides a general connection pool manager widely used in various client communication modules of the Acl library.
Application Scenarios
- Redis client connection pool
- Database connection pool
- HTTP client connection pool
- Other network client connection pools
In addition to the Redis client, Acl implements various commonly used client communication libraries.
Supported Clients
- Memcached: Supports connection pool
- Handler Socket: Client for MySQL's Handler Socket plugin
- Beanstalk: Message queue client
- Disque: Distributed message queue client
Acl provides a complete DNS solution that can use system APIs or directly implement DNS protocol.
Features
- System API Wrapper: Wraps system APIs such as
getaddrinfoandgethostbyname - Protocol Implementation: Complete implementation of DNS protocol specified in RFC1035
- Dual-End Support: Can be used to implement DNS client or DNS server
- Result Caching: Supports DNS query result caching to improve performance
Acl is a cross-platform library supporting mainstream operating systems and multiple compilation toolchains.
Supported Platforms
- Linux, Windows, macOS, FreeBSD, Solaris
- Android, iOS, Harmony
Compilation Methods
Linux/UNIX Platform
-
Compiler: gcc/clang
-
Make Method:
cd acl/ makeAfter compilation, the following will be generated in the
acl/directory:libacl_all.a(static library, containing lib_acl.a, lib_protocol.a, and libacl_cpp.a)libacl_all.so(dynamic library)
-
CMake Method:
./cmake-build.sh
-
XMake Method:
xmake
Windows Platform
- Supports Visual Studio 2003/2008/2010/2012/2013/2015/2019 and other versions
- For VS6/VS2005, refer to VS2003 compilation configuration
macOS/iOS Platform
- Compile using Xcode
Android Platform
- Open the
acl/android/acl_ndk20b/project with Android Studio
Harmony Platform
- Open the
acl/harmony/api13/project with DevEco Studio
Cross-Platform Compilation
- Supports cross-platform compilation using CMake
When using Acl dynamic libraries in Windows environment, you need to add corresponding predefined macros in your project.
Predefined Macro Description
| Library Used | Required Predefined Macro | Description |
|---|---|---|
| lib_acl dynamic library | ACL_DLL |
Base library |
| lib_protocol HTTP library | HTTP_DLL |
HTTP protocol library |
| lib_protocol ICMP library | ICMP_DLL |
ICMP protocol library |
| lib_acl_cpp dynamic library | ACL_CPP_DLL |
C++ library |
Detailed Instructions
- For detailed compilation process and configuration methods, see: Acl Library Compilation and Usage
This is the simplest Acl program, demonstrating how to use Acl's string class.
#include <iostream>
#include "acl_cpp/lib_acl.hpp"
int main() {
acl::string buf = "hello world!\r\n";
std::cout << buf.c_str() << std::endl;
return 0;
}This example shows how to create a simple TCP echo server using Acl, handling client connections with multiple threads.
#include <thread>
#include "acl_cpp/lib_acl.hpp"
void run() {
const char* addr = "127.0.0.1:8088";
acl::server_socket server;
if (!server.open(addr)) { // Bind and listen on local address.
return;
}
while (true) {
acl::socket_stream* conn = server.accept(); // Wait for connection.
if (conn == NULL) {
break;
}
std::thread thread([=] { // Start a thread to handle the connection.
char buf[256];
int ret = conn->read(buf, sizeof(buf), false); // Read data.
if (ret > 0) {
conn->write(buf, ret); // Write received data.
}
delete conn;
});
thread.detach();
}
}This example shows how to create a TCP client using Acl, connecting to a server and sending/receiving data.
#include "acl_cpp/lib_acl.hpp"
void run() {
const char* addr = "127.0.0.1:8088";
int conn_timeout = 5, rw_timeout = 10;
acl::socket_stream conn;
if (!conn.open(addr, conn_timeout, rw_timeout)) { // Connect to server.
return;
}
const char data[] = "Hello world!\r\n";
if (conn.write(data, sizeof(data) - 1) == -1) { // Send data to server.
return;
}
char buf[256];
int ret = conn.read(buf, sizeof(buf) - 1, false);
if (ret > 0) { // Read from server.
buf[ret] = 0;
std::cout << buf << std::endl;
}
}This example shows how to create a high-concurrency TCP server using Acl coroutines, implementing asynchronous processing with sequential programming style.
#include "acl_cpp/lib_acl.hpp"
#include "fiber/go_fiber.hpp"
void run() {
const char* addr = "127.0.0.1:8088";
acl::server_socket server;
if (!server.open(addr)) {
return;
}
go[&] { // Create a server coroutine to wait for connections.
while (true) {
acl::shared_stream conn = server.shared_accept();
if (conn == nullptr) {
break;
}
go[conn] { // Create a client coroutine to handle the connection.
while (true) {
char buf[256];
int ret = conn->read(buf, sizeof(buf), false);
if (ret <= 0 || conn->write(buf, ret) != ret) {
break;
}
}
};
}
};
acl::fiber::schedule(); // Start the coroutine scheduling process.
}This example shows how to create an HTTP client using Acl, sending HTTP requests and getting responses.
#include "acl_cpp/lib_acl.hpp"
bool run() {
acl::http_request conn("www.baidu.com:80");
acl::http_header& header = conn.request_header()
header.set_url("/")
.set_keep_alive(false);
.set_content_type("text/html");
if (!conn.request(NULL, 0)) {
return false;
}
int status = conn.http_status();
if (status != 200) {
return false;
}
long long len = conn.body_length();
if (len <= 0) {
return true;
}
acl::string buf;
if (!conn.get_body(body)) {
return false;
}
return true;
}This example shows how to create a fully-featured HTTP server using Acl coroutines, supporting routing, configuration management, and other features.
#include "acl_cpp/lib_acl.hpp" // Must be before http_server.hpp
#include "fiber/http_server.hpp"
static char *var_cfg_debug_msg;
static acl::master_str_tbl var_conf_str_tab[] = {
{ "debug_msg", "test_msg", &var_cfg_debug_msg },
{ 0, 0, 0 }
};
static int var_cfg_io_timeout;
static acl::master_int_tbl var_conf_int_tab[] = {
{ "io_timeout", 120, &var_cfg_io_timeout, 0, 0 },
{ 0, 0 , 0 , 0, 0 }
};
int main(int argc, char* argv[]) {
const char* addr = "0.0.0.0|8194";
const char* conf = argc >= 2 ? argv[1] : NULL;
acl::http_server server;
// Call methods in acl::master_base class.
server.set_cfg_int(var_conf_int_tab).set_cfg_str(var_conf_str_tab);
// Call methods in acl::http_server.
server.on_proc_init([&addr] {
printf("---> after process init: addr=%s, io_timeout=%d\r\n", addr, var_cfg_io_timeout);
}).on_proc_exit([] {
printf("---> before process exit\r\n");
}).on_proc_sighup([] (acl::string& s) {
s = "+ok";
printf("---> process got sighup\r\n");
return true;
}).on_thread_accept([] (acl::socket_stream& conn) {
printf("---> accept %d\r\n", conn.sock_handle());
return true;
}).Get("/", [](acl::HttpRequest&, acl::HttpResponse& res) {
std::string buf("hello world1!\r\n");
res.setContentLength(buf.size());
return res.write(buf.c_str(), buf.size());
}).Post("/json", [](acl::HttpRequest& req, acl::HttpResponse& res) {
acl::json* json = req.getJson();
if (json) {
return res.write(*json);
} else {
std::string buf = "no json got\r\n";
res.setContentLength(buf.size());
return res.write(buf.c_str(), buf.size());
}
}).run_alone(addr, conf);
return 0;
}This example shows how to use the Acl Redis client for multi-threaded operations, including connection pool management and basic Redis commands.
#include <thread>
#include "acl_cpp/lib_acl.hpp"
static void thread_run(acl::redis_client_cluster& conns) {
acl::redis cmd(&conns);
std::map<acl::string, acl::string> attrs;
attrs["name1"] = "value1";
attrs["name2"] = "value2";
attrs["name3"] = "value3";
acl::string key = "hash-key-1";
if (!cmd.hmset(key, attrs)) {
printf("hmset error=%s\r\n", cmd.result_error());
return;
}
attrs.clear();
if (!cmd.hgetall(key, attrs)) {
printf("hgetall error=%s\r\n", cmd.result_error());
}
}
void run() {
const char* addr = "126.0.0.1:6379";
acl::redis_client_cluster conns;
conns.set(addr, 0);
const size_t nthreads = 10;
std::thread threads[nthreads];
// Create some threads to test redis using the same conns.
for (size_t i = 0; i < nthreads; i++) {
threads[i] = std::thread(thread_run, std::ref(conns));
}
// Wait for all threads to exit
for (size_t i = 0; i < nthreads; i++) {
threads[i].join();
}
}The Acl library provides a large number of sample codes for learning and reference, covering the usage of various functional modules.
Sample Index: SAMPLES.md
To help developers get started quickly, we provide many simple and easy-to-understand small examples.
Sample Repository: Acl Demos
Encountering problems when using Acl? Check the frequently asked questions.
FAQ Document: FAQ.md
Acl adopts the LGPL-v2.1 open source license and can be freely used in commercial and non-commercial projects.
License Details: LICENSE.txt
Official Resources
- π Official Website: https://acl-dev.cn/
- π» GitHub: https://github.com/acl-dev/acl
- π¨π³ Gitee: https://gitee.com/acl-dev/acl
- π Technical Blog: https://blog.csdn.net/zsxxsz
- π¦ Weibo: http://weibo.com/zsxxsz
Community
- π¬ QQ Group: 705290654
Thanks to
for supporting the Acl project.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Application Layer β
β Business code, HTTP server, WebSocket service, etc. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β High-level API Layer β
β ββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ β
β β HTTP β Redis β MQTT β DB β β
β β Module β Module β Module β Module β β
β ββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ β
β ββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ β
β β Master β Fiber β ConnPool β Stream β β
β βFramework βCoroutine β Pool βProcessingβ β
β ββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Core Library Layer β
β - Network I/O (socket, stream, aio) β
β - Event-driven (event, epoll, kqueue, iocp) β
β - Memory management (memory pool, dbuf) β
β - Data structures (string, array, hash, list) β
β - Utilities (log, config, thread, process) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Operating System Layer β
β Linux / FreeBSD / macOS / Windows / Android / iOS / Harmony β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
acl/
βββ lib_acl/ # Core C library (base library)
β βββ include/ # Public header files
β βββ src/ # Source code implementation
β β βββ stdlib/ # Standard library (string, memory, file, etc.)
β β β βββ common/ # Common data structures (hash, list, queue, tree, etc.)
β β β βββ memory/ # Memory management (memory pool, slab, dbuf)
β β β βββ string/ # String operations
β β β βββ filedir/ # File and directory operations
β β β βββ configure/ # Configuration file parsing
β β β βββ iostuff/ # IO utility functions
β β β βββ debug/ # Debugging tools
β β β βββ sys/ # System-related wrappers
β β βββ net/ # Network module
β β β βββ connect/ # Client connection
β β β βββ listen/ # Server listening
β β β βββ dns/ # DNS resolution
β β βββ event/ # Event engine (epoll/kqueue/iocp/select/poll)
β β βββ aio/ # Asynchronous IO module
β β βββ thread/ # Thread and thread pool
β β βββ master/ # Server framework (process management)
β β β βββ template/ # Service templates (process/thread/aio/coroutine/UDP/trigger)
β β βββ db/ # Database module
β β β βββ mysql/ # MySQL support
β β β βββ memdb/ # In-memory database
β β β βββ zdb/ # ZDB storage engine
β β βββ json/ # JSON parser
β β βββ xml/ # XML parser
β β βββ code/ # Encoding/decoding (base64/url/html, etc.)
β β βββ msg/ # Message queue
β β βββ init/ # Initialization module
β β βββ ioctl/ # IO control
β β βββ proctl/ # Process control (Windows)
β β βββ unit_test/ # Unit testing framework
β βββ samples/ # Extensive sample code
β
βββ lib_protocol/ # Protocol library (C implementation)
β βββ include/ # Protocol header files
β βββ src/ # Protocol implementation
β β βββ http/ # HTTP protocol
β β βββ icmp/ # ICMP/Ping protocol
β β βββ smtp/ # SMTP mail protocol
β βββ samples/ # Protocol samples
β
βββ lib_acl_cpp/ # C++ wrapper library (advanced features)
β βββ include/ # C++ header files
β β βββ acl_cpp/ # Main header directory
β β β βββ stdlib/ # Standard library wrapper
β β β βββ stream/ # Stream processing
β β β βββ http/ # HTTP client and server
β β β βββ redis/ # Redis client
β β β βββ mqtt/ # MQTT protocol
β β β βββ db/ # Database wrapper
β β β βββ mime/ # MIME protocol
β β β βββ master/ # Master framework wrapper
β β β βββ connpool/ # Connection pool
β β β βββ session/ # Session management
β β β βββ memcache/ # Memcached client
β β β βββ beanstalk/ # Beanstalk client
β β β βββ disque/ # Disque client
β β β βββ hsocket/ # Handler Socket client
β β β βββ ipc/ # Inter-process communication
β β β βββ queue/ # File queue
β β β βββ serialize/ # Serialization (JSON/Gson)
β β β βββ aliyun/ # Aliyun SDK (OSS, to be implemented)
β β β βββ event/ # Event wrapper
β βββ src/ # C++ source implementation
β β βββ stdlib/ # Standard library implementation (string/logger/charset/zlib, etc.)
β β βββ stream/ # Stream implementation (socket/ssl/aio)
β β βββ http/ # HTTP implementation
β β β βββ h2/ # HTTP/2 support (to be implemented)
β β β βββ h3/ # HTTP/3 support (to be implemented)
β β βββ redis/ # Redis client implementation
β β βββ mqtt/ # MQTT protocol implementation
β β βββ db/ # Database implementation
β β βββ mime/ # MIME implementation
β β βββ master/ # Master framework implementation
β β βββ connpool/ # Connection pool implementation
β β βββ session/ # Session implementation
β β βββ memcache/ # Memcached implementation
β β βββ beanstalk/ # Beanstalk implementation
β β βββ disque/ # Disque implementation
β β βββ hsocket/ # Handler Socket implementation
β β βββ ipc/ # IPC implementation
β β βββ queue/ # Queue implementation
β β βββ serialize/ # Serialization implementation
β β βββ smtp/ # SMTP implementation
β β βββ aliyun/ # Aliyun OSS client implementation(to be implemented)
β β βββ net/ # Network utilities (DNS)
β βββ samples/ # Rich sample code
β βββ http/ # HTTP samples
β βββ redis/ # Redis samples
β βββ mqtt/ # MQTT samples
β βββ db/ # Database samples
β βββ master/ # Master framework samples
β βββ fiber/ # Coroutine samples
β βββ ... # More samples
β
βββ lib_fiber/ # Coroutine library (core features)
β βββ c/ # C language implementation
β β βββ include/ # Coroutine header files
β β βββ src/ # Coroutine source code
β β βββ common/ # Common modules
β β βββ fiber/ # Coroutine core
β β βββ event/ # Event engine
β β βββ sync/ # Synchronization primitives (mutex/sem/event)
β β βββ hook/ # System API Hook
β β βββ ...
β βββ cpp/ # C++ wrapper
β β βββ include/ # C++ header files
β β βββ src/ # C++ implementation
β βββ samples-c/ # C language samples
β βββ samples-c++/ # C++ samples
β βββ samples-c++1x/ # C++11/14/17 samples
β βββ samples-gui/ # GUI samples (Windows)
β βββ unit_test/ # Unit tests
β
βββ lib_dict/ # Dictionary library (optional)
β βββ bdb/ # Berkeley DB support
β βββ cdb/ # CDB support
β βββ tc/ # Tokyo Cabinet support
β
βββ lib_tls/ # TLS/SSL library (optional)
β βββ src/ # TLS implementation
β
βββ lib_rpc/ # RPC library (experimental)
β βββ src/ # RPC implementation
β
βββ app/ # Applications and tools
β βββ wizard/ # Code generation wizard (important tool)
β β βββ tmpl/ # Service templates (process/thread/aio/coroutine/UDP/trigger)
β βββ wizard_demo/ # Sample projects generated by wizard
β βββ master/ # Master service manager
β β βββ daemon/ # Daemon process
β β βββ tools/ # Management tools
β β βββ ...
β βββ jaws/ # Web application server
β βββ redis_tools/ # Redis toolset
β βββ net_tools/ # Network tools
β βββ gson/ # JSON serialization tool
β βββ jencode/ # Encoding conversion tool
β βββ iconv/ # Character set conversion
β βββ ...
β
βββ doc/ # Documentation directory
β βββ README.md # Documentation index
β βββ fiber/ # Coroutine documentation
β βββ http/ # HTTP documentation
β βββ redis/ # Redis documentation
β βββ mqtt/ # MQTT documentation
β βββ db/ # Database documentation
β βββ master/ # Master framework documentation
β βββ stream/ # Stream documentation
β βββ mime/ # MIME documentation
β βββ connpool/ # Connection pool documentation
β βββ rfc/ # RFC documentation
β βββ ...
β
βββ include/ # Third-party library header files
β βββ mysql/ # MySQL header files
β βββ pgsql/ # PostgreSQL header files
β βββ sqlite/ # SQLite header files
β βββ openssl-1.1.1q/ # OpenSSL header files
β βββ mbedtls/ # MbedTLS header files
β βββ polarssl/ # PolarSSL header files
β βββ zlib-1.2.11/ # Zlib header files
β βββ ...
β
βββ lib/ # Pre-compiled library files (by platform)
β βββ linux64/ # Linux 64-bit
β βββ linux32/ # Linux 32-bit
β βββ win32/ # Windows 32-bit
β βββ win64/ # Windows 64-bit
β βββ macos/ # macOS
β βββ freebsd/ # FreeBSD
β βββ solaris/ # Solaris
β
βββ android/ # Android platform support
β βββ acl_ndk20b/ # NDK r20b project
β βββ acl_ndk28c/ # NDK r28c project
β βββ samples/ # Android samples
β
βββ harmony/ # Harmony platform support
β βββ api9/ # HarmonyOS API 9
β βββ api12/ # HarmonyOS API 12
β βββ api13/ # HarmonyOS API 13
β βββ api16/ # HarmonyOS API 16
β
βββ xcode/ # Xcode project (macOS/iOS)
β βββ ... # Xcode project files
β
βββ dist/ # Installation directory (after make install)
β βββ include/ # Installed header files
β βββ lib/ # Installed library files
β βββ master/ # Master configuration and scripts
β
βββ unit_test/ # Unit tests
β βββ ... # Test cases
β
βββ packaging/ # Packaging configuration
β βββ ... # RPM/DEB packaging scripts
β
βββ CMakeLists.txt # CMake build configuration
βββ Makefile # Main Makefile
βββ xmake.lua # XMake build configuration
βββ README.md # English documentation
βββ README_CN.md # Chinese documentation
βββ SAMPLES.md # Sample code index
βββ FAQ.md # Frequently asked questions
βββ BUILD.md # Build instructions
βββ LICENSE.txt # Open source license
βββ changes.txt # Change log
