[中文简体](README_CN.md)
# Acl -- One Advanced C/C++ Library for Unix/Windows
# 0. About Acl project
The Acl (Advanced C/C++ Library) project a is powerful multi-platform network communication library and service framework, suppoting LINUX, WIN32, Solaris, FreeBSD, MacOS, AndroidOS, iOS. Many applications written by Acl run on these devices with Linux, Windows, iPhone and Android and serve billions of users. There are some important modules in Acl project, including network communcation, server framework, application protocols, multiple coders, etc. The common protocols such as HTTP/SMTP/ICMP//MQTT/Redis/Memcached/Beanstalk/Handler Socket are implemented in Acl, and the codec library such as XML/JSON/MIME/BASE64/UUCODE/QPCODE/RFC2047/RFC1035, etc., are also included in Acl. Acl also provides unified abstract interface for popular databases such as Mysql, Postgresql, Sqlite. Using Acl library users can write database application more easily, quickly and safely.
Architecture diagram:
![Overall architecture diagram](res/img/architecture_en.png)
<hr>
* [0. About Acl project](#0-about-acl-project)
* [1. The six most important modules](#1-the-six-most-important-modules)
* [1.1. Basic network module](#11-basic-network-module)
* [1.2. Coroutine](#12-coroutine)
* [1.3. HTTP module](#13-http-module)
* [1.4. Redis client](#14-redis-client)
* [1.5. MQTT module](#15-mqtt-module)
* [1.6. Server framework](#16-server-framework)
* [2. The other important modules](#2-the-other-important-modules)
* [2.1. MIME module](#21-mime-module)
* [2.2. Codec module](#22-codec-module)
* [2.3. Database module](#23-database-module)
* [2.4. Connection pool manager](#24-connection-pool-manager)
* [2.5. The other client libraries](#25-the-other-client-libraries)
* [2.6. DNS module](#26-dns-module)
* [3. Platform support and compilation](#3-platform-support-and-compilation)
* [3.1. Compiling Acl on different platforms](#31-compiling-acl-on-different-platforms)
* [3.2. Precautions when compiling on Windows](#32-precautions-when-compiling-on-windows)
* [4. Quick start](#4-quick-start)
* [4.1. The first demo with Acl](#41-the-first-demo-with-acl)
* [4.2. Simple TCP server](#42-simple-tcp-server)
* [4.3. Simple TCP client](#43-simple-tcp-client)
* [4.4. Coroutine TCP server](#44-coroutine-tcp-server)
* [4.5. One Http client](#45-one-http-client)
* [4.6. Coroutine Http server](#46-coroutine-http-server)
* [4.7. One Redis client](#47-one-redis-client)
* [5. More about](#5-more-about)
* [5.1. Samples](#51-samples)
* [5.2. FAQ](#52-faq)
* [5.3. Who are using acl?](#53-who-are-using-acl)
* [5.4. License](#54-license)
* [5.5. Reference](#55-reference)
* [5.6. Thanks](#56-thanks)
<hr>
# 1. The six most important modules
As a C/C++ foundation library, Acl provides many useful functions for users to develop applications, including six important modules: Network, Coroutine, HTTP, Redis client, MQTT, and Server framework.
## 1.1. Basic network module
- Stream processing module
This module is the most basic streaming communication module for the entire acl network communication. It not only supports network streaming, but also supports file streaming. It mainly supports:
- Read data by line, compatible with \r\n under win32, and compatible with the end of \n under UNIX
- Read data by line but require automatic removal of the trailing \n or \r\n
- Read data as a string separator
- Read the specified length of data
- Try to read a row of data or try to read the specified length of data
- Detect network IO status
- Write a row of data
- Write data by formatter, similar to fprintf
- File stream location operation, similar to fseek
- Write a set of data at once, similar to writev under unix
- Truncate the file, similar to ftrunk
- Get the file size
- Get the current file stream pointer location, similar to ftell
- Get the file size
- Obtain the local address and remote address of the network stream
- Network operation module
- This module mainly supports network server monitoring (supports TCP/UDP/UNIX domain socket), network client connection (supports TCP/UNIX domain socket), DNS domain name query and result cache (supports calling system gethostbyname/getaddrinfo function and direct Send DNS protocol two ways), socket (socket) operation and take the local network card and other functions.
- Non-blocking network flow
- Support non-blocking mode connection, read (by row read, specified length read), write (write line, write specified length, write a set of data) and other operations.
- Common network application protocol library
- It mainly supports common network application protocols, such as: HTTP, SMTP, ICMP, in which HTTP and ICMP modules implement blocking and non-blocking communication methods. In addition, the HTTP protocol supports server and client in C++ version of lib_acl_cpp. Two communication methods, when used as a server, support the interface usage similar to JAVA HttpServlet. When used as a client mode, it supports connection pool and cluster management. The module supports both cookie, session, and HTTP MIME file upload. Rich functions such as block transfer, automatic character set conversion, automatic decompression, and breakpoint resume.
- Common network communication library
- Support memcached, beanstalk, handler socket client communication library, the communication library supports connection pool mode.
## 1.2. Coroutine
The coroutine module in Acl can be used on multiple platforms, and there are many engineering practices in some important projects.
- Run on Linux, MacOS, Windows, iOS and Android
- Support x86, Arm architecture
- Support select/poll/epoll/kqueue/iocp/win32 GUI message
- The DNS protocol has been implemented in acl coroutine, so DNS API can also be used in coroutine model
- Hook system IO API on Unix and Windows
- **Read API:** read/readv/recv/recvfrom/recvmsg
- **Write API:** write/writev/send/sendto/sendmsg/sendfile64
- **Socket API:** socket/listen/accept/connect/setsockopt
- **event API:** select/poll/epoll_create/epoll_ctl/epoll_wait
- **DNS API:** gethostbyname/gethostbyname_r/getaddrinfo/freeaddrinfo
- Support **shared stack** mode to minimize memory usage
- Synchronization primitive
- Coroutine **mutex**, **semphore** can be used between coroutines
- Coroutine **event** can be used between coroutines and threads
- For more information, see **[Using Acl fiber](lib_fiber/README_en.md)**
## 1.3. HTTP module
Supports HTTP/1.1, can be used in client and server sides.
- HttpServlet interface like Java(server side)
- Connection pool mode(client side)
- Chunked block transfer
- Gzip compression/decompression
- SSL encrypted
- Breakpoints transmission
- Setting/acquisition of cookies
- Session managment(server side)
- Websocket transmission
- HTTP MIME format
- Sync/Async mode
- ...
## 1.4. Redis client
The redis client module in Acl is powerful, high-performance and easy to use.
- Support Bitmap/String/Hash/List/Set/Sorted Set/PubSub/HyperLogLog/Geo/Script/Stream/Server/Cluster/etc.
- Provides stl-like C++ interface for each redis command
- Automaticaly cache and adapt the changing of hash slots of the redis cluster on the client
- Communication in single, cluster or pipeline mode
- Connection pool be used in signle or cluster mode
- High performance in cluster or pipline mode
- Same interface for single, cluster and pipeline modes
- Retry automatically for the reason of network error
- Can be used in the shared stack coroutine mode
- For more information, see **[Using Acl redis client](lib_acl_cpp/samples/redis/README.md)**
## 1.5. MQTT module
The MQTT 3.1.1 version has been implemented in Acl, which has a stream parser, so can be used indepedentily of any IO mode.
- Support **MQTT 3.1.1** protocol: CONNECT/CONNACK/PUBLISH/PUBACK/PUBREC/PUBREL/PUBCOMP/SUBSCRIBE/SUBACK/UNSUBSCRI
没有合适的资源?快使用搜索试试~ 我知道了~
acl 框架库 v3.6.1.6.zip
共2000个文件
h:1053个
cpp:323个
c:147个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 89 浏览量
2024-03-18
21:17:50
上传
评论
收藏 28.75MB ZIP 举报
温馨提示
acl 框架库 v3.6.1.6.zip
资源推荐
资源详情
资源评论
收起资源包目录
acl 框架库 v3.6.1.6.zip (2000个子文件)
http_proxy.c 38KB
tls_client.c 34KB
dict_db.c 31KB
http_hdr_req.c 26KB
tls_server.c 26KB
tls_misc.c 25KB
attr_scan64.c 18KB
attr_scan_plain.c 18KB
tls_verify.c 18KB
attr_scan0.c 16KB
smtp_client.c 16KB
http_hdr.c 16KB
tls_scache.c 14KB
http_chat_async.c 14KB
dict.c 13KB
http_util.c 12KB
logger.c 12KB
tls_bio_ops.c 11KB
dict_cdb.c 11KB
tls_mgr.c 11KB
auto_clnt.c 11KB
dict_tc.c 10KB
dict_pool.c 10KB
http_chat_sync.c 9KB
tls_dh.c 9KB
attr_print64.c 9KB
conn_cache.c 8KB
http_server.c 8KB
attr_print0.c 8KB
gid_oper.c 8KB
dns_cache.c 8KB
forward.c 8KB
dns_lookup.c 8KB
http_hdr_res.c 8KB
http_tmpl.c 7KB
attr_print_plain.c 7KB
dns_server.c 7KB
name_mask.c 7KB
http_vhost.c 7KB
main.c 6KB
app_log.c 6KB
icmp_pkt.c 6KB
icmp_chat_aio.c 6KB
main.c 6KB
attr_clnt.c 6KB
service_main.c 6KB
main.c 6KB
mac_expand.c 5KB
http_plugin.c 5KB
main.c 5KB
main.c 5KB
http_hdr_build.c 5KB
main.c 5KB
smtp_client.c 5KB
tls_certkey.c 5KB
http_cgi.c 5KB
http_res_filter.c 5KB
http_client.c 5KB
http_module.c 5KB
tls_session.c 4KB
tls_prng_egd.c 4KB
dict_open.c 4KB
service_main.c 4KB
tls_prng_exch.c 4KB
tls_prng_file.c 4KB
client_entry.c 4KB
service_ipc.c 4KB
tls_prng_dev.c 4KB
tls_stream.c 4KB
main.c 4KB
main.c 4KB
icmp_stat.c 4KB
unescape.c 4KB
main.c 3KB
dns_hosts.c 3KB
mac_parse.c 3KB
main.c 3KB
http_status.c 3KB
cmdline_service.c 3KB
check_mem.c 3KB
http_service.c 3KB
name_mask.c 3KB
icmp_stream.c 3KB
dict_alloc.c 3KB
http_xml.c 3KB
icmp_timer.c 3KB
http_json.c 3KB
gid_xml.c 3KB
http_conf.c 3KB
dict_debug.c 3KB
http_client.c 3KB
icmp_chat_sio.c 3KB
tcp_proxy.c 3KB
service.c 3KB
main.c 2KB
main.c 2KB
gid_json.c 2KB
http_plugin.c 2KB
http_req_filter.c 2KB
main.c 2KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
芝麻粒儿
- 粉丝: 5w+
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功