mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-01 19:37:45 +08:00
acl 3.1.2 version released
This commit is contained in:
parent
dd45047dee
commit
ab5ec2e6e4
2
Makefile
2
Makefile
@ -42,7 +42,7 @@ endif
|
||||
##############################################################################
|
||||
|
||||
.PHONY = check help all clean install uninstall uninstall_all build_bin build_src
|
||||
VERSION = 3.1.0
|
||||
VERSION = 3.1.2
|
||||
|
||||
help:
|
||||
@(echo "usage: make help|all|clean|install|uninstall|uninstall_all|build_bin|build_src")
|
||||
|
@ -148,7 +148,8 @@ acl
|
||||
- 13 queue: 磁盘文件队列操作库
|
||||
- 14 ipc: 阻塞/非阻塞通信整合库
|
||||
- 15 session: HTTP 会话库
|
||||
- 16 redis: 完整实现了 redis 协议的客户端通信库(总共 12 个大类,150 多个命令),支持连接池及连接池集群管理
|
||||
- **16 redis: 完整实现了 redis 协议的客户端通信库(总共 12 个大类,150 多个命令),支持连接池及连接池集群管理**
|
||||
- 17 disque: 支持集群消息队列服务 disque 的客户端库,支持连接池及连接池集群管理
|
||||
|
||||
### 3.4、图例
|
||||
* 类索引图:
|
||||
|
@ -1,5 +1,6 @@
|
||||
修改历史列表:
|
||||
------------------------------------------------------------------------
|
||||
86) 2015.5.9 --- acl 3.1.2 版本发布!
|
||||
85) 2015.5.5
|
||||
85.1) lib_acl_cpp/samples/disque: 测试分布式消息队列 disque 客户端库例子
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "init.h"
|
||||
|
||||
static char *version = "acl_3.1.1";
|
||||
static char *version = "acl_3.1.2";
|
||||
|
||||
const char *acl_version(void)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ int main(void)
|
||||
```
|
||||
|
||||
### add acl disque to your projects
|
||||
Before you use the acl disque, you should compile the three base libraries which disque depending on. Enter the ** lib_acl, lib_protocol, lib_acl_cpp,** and build the lib_acl.a, lib_protocol.a and lib_acl_cpp.a.
|
||||
Before you use the acl disque, you should compile the three base libraries which disque depending on. Enter the `lib_acl`, `lib_protocol`, `lib_acl_cpp`, and build the `lib_acl.a`, `lib_protocol.a` and `lib_acl_cpp.a`.
|
||||
```compile
|
||||
$cd lib_acl; make
|
||||
$cd lib_protocol; make
|
||||
@ -152,7 +152,7 @@ $cd lib_acl_cpp; make
|
||||
In your Makefile, you should add below compiling flags:
|
||||
-DLINUX2 for LINUX, -DFREEBSD for FreeBSD, -DMACOSX for MAXOS, -DSUNOS5 for Solaris X86;
|
||||
-I path specify the lib_acl.hpp's parent path, for exmaple: -I./lib_acl_cpp/include, in the lib_acl_cpp/include path the acl_cpp path should be included;
|
||||
At last, link with ** -L{path_to_acl_cpp} -l_acl_cpp -L{path_to_protocol} -l_protocol -L{path_to_acl) -l_acl **
|
||||
At last, link with `-L{path_to_acl_cpp} -l_acl_cpp -L{path_to_protocol} -l_protocol -L{path_to_acl) -l_acl`
|
||||
Of couse you can look at the Makefile.in in lib_acl_cpp\samples and Makfile in lib_acl_cpp\samples\disque\ to find the build conditions.
|
||||
One Makefile as below:
|
||||
```Makefile
|
||||
|
@ -8,13 +8,13 @@ The header files of acl redis are in lib_acl_cpp\include\acl_cpp\redis; the sour
|
||||
Because acl redis lib is a part of lib_acl_cpp lib, and lib_acl_cpp depend lib_acl and lib_protocol, you should compile lib_acl and lib_protocol libs first, and compile lib_acl_cpp lib. After you've compiled lib_acl_cpp lib, the redis lib is also compiled OK.
|
||||
|
||||
### compile on UNIX/LINUX
|
||||
- 1 compile ** lib_acl.a **: Enter into lib_acl path and type make, the lib_acl.a will be compiled
|
||||
- 2 compile ** lib_protocol.a **: Enter into lib_protocol path and type make, the lib_protocol.a will be compiled
|
||||
- 3 compile ** lib_acl_cpp.a **: Enter into lib_acl_cpp path and type make, the lib_acl_cpp.a will be compiled
|
||||
- 1 compile `lib_acl.a`: Enter into *lib_acl* path and type make, the lib_acl.a will be compiled
|
||||
- 2 compile `lib_protocol.a`: Enter into *lib_protocol* path and type make, the lib_protocol.a will be compiled
|
||||
- 3 compile `lib_acl_cpp.a`: Enter into *lib_acl_cpp* path and type make, the lib_acl_cpp.a will be compiled
|
||||
- 4 compile redis samples: Enter into lib_acl_cpp\samples\redis and type make, all the redis samples(including redis_cluster, redis_connection, redis_hash, redis_hyperloglog, redis_key, redis_lib, redis_manager, redis_pool, redis_pubsub, redis_server, redis_set, redis_string, redis_trans, redis_zset, redis_zset_pool, redis_client_cluster) will be compiled.
|
||||
|
||||
### compile on WINDOWS
|
||||
You can use VC2003, VC2008, VC2010, VC2012 to build all acl libs including acl redis lib in lib_acl_cpp module when you open the acl projects(acl_cpp_vc2003.sln, acl_cpp_vc2008.sln, acl_cpp_vc2010.sln, acl_cpp_vc2012.sln). You should build lib_acl first, and second build lib_protocol, and third build lib_acl_cpp, and at last build all the acl samples including redis samples.
|
||||
You can use `VC2003`, `VC2008`, `VC2010`, `VC2012` to build all acl libs including acl redis lib in lib_acl_cpp module when you open the acl projects(acl_cpp_vc2003.sln, acl_cpp_vc2008.sln, acl_cpp_vc2010.sln, acl_cpp_vc2012.sln). You should build lib_acl first, and second build lib_protocol, and third build lib_acl_cpp, and at last build all the acl samples including redis samples.
|
||||
|
||||
## write some samples using acl redis lib
|
||||
### simple example for redis STRING and redis KEY:
|
||||
@ -214,7 +214,7 @@ int main(void)
|
||||
```
|
||||
|
||||
### add acl redis to your projects
|
||||
Before you use the acl redis, you should compile the three base libraries which redis depending on. Enter the lib_acl, lib_protocol, lib_acl_cpp, and build the ** lib_acl.a, lib_protocol.a and lib_acl_cpp.a **.
|
||||
Before you use the acl redis, you should compile the three base libraries which redis depending on. Enter the *lib_acl*, *lib_protocol*, *lib_acl_cpp*, and build the `lib_acl.a`, `lib_protocol.a` and `lib_acl_cpp.a`.
|
||||
```compile
|
||||
$cd lib_acl; make
|
||||
$cd lib_protocol; make
|
||||
|
@ -91,7 +91,10 @@ redis_result* redis_client::get_redis_error(dbuf_pool* pool)
|
||||
{
|
||||
buf_.clear();
|
||||
if (conn_.gets(buf_) == false)
|
||||
{
|
||||
logger_error("gets line error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
redis_result* rr = new(pool) redis_result(pool);
|
||||
rr->set_type(REDIS_RESULT_ERROR);
|
||||
@ -105,7 +108,10 @@ redis_result* redis_client::get_redis_status(dbuf_pool* pool)
|
||||
{
|
||||
buf_.clear();
|
||||
if (conn_.gets(buf_) == false)
|
||||
{
|
||||
logger_error("gets line error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
redis_result* rr = new(pool) redis_result(pool);
|
||||
rr->set_type(REDIS_RESULT_STATUS);
|
||||
@ -119,7 +125,10 @@ redis_result* redis_client::get_redis_integer(dbuf_pool* pool)
|
||||
{
|
||||
buf_.clear();
|
||||
if (conn_.gets(buf_) == false)
|
||||
{
|
||||
logger_error("gets line error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
redis_result* rr = new(pool) redis_result(pool);
|
||||
rr->set_type(REDIS_RESULT_INTEGER);
|
||||
@ -133,7 +142,10 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
|
||||
{
|
||||
buf_.clear();
|
||||
if (conn_.gets(buf_) == false)
|
||||
{
|
||||
logger_error("gets line error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
redis_result* rr = new(pool) redis_result(pool);
|
||||
rr->set_type(REDIS_RESULT_STRING);
|
||||
int len = atoi(buf_.c_str());
|
||||
@ -147,14 +159,20 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
|
||||
rr->set_size(1);
|
||||
buf = (char*) pool->dbuf_alloc(len + 1);
|
||||
if (len > 0 && conn_.read(buf, (size_t) len) == -1)
|
||||
{
|
||||
logger_error("read data error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
buf[len] = 0;
|
||||
rr->put(buf, (size_t) len);
|
||||
|
||||
// ¶Á \r\n
|
||||
buf_.clear();
|
||||
if (conn_.gets(buf_) == false)
|
||||
{
|
||||
logger_error("gets line error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
return rr;
|
||||
}
|
||||
|
||||
@ -173,7 +191,10 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
|
||||
n = len > CHUNK_LENGTH - 1 ? CHUNK_LENGTH - 1 : len;
|
||||
buf = (char*) pool->dbuf_alloc((size_t) (n + 1));
|
||||
if (conn_.read(buf, (size_t) n) == -1)
|
||||
{
|
||||
logger_error("read data error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
buf[n] = 0;
|
||||
rr->put(buf, (size_t) n);
|
||||
len -= n;
|
||||
@ -181,7 +202,10 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
|
||||
|
||||
buf_.clear();
|
||||
if (conn_.gets(buf_) == false)
|
||||
{
|
||||
logger_error("gets line error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
return rr;
|
||||
}
|
||||
|
||||
@ -215,7 +239,7 @@ redis_result* redis_client::get_redis_object(dbuf_pool* pool)
|
||||
char ch;
|
||||
if (conn_.read(ch) == false)
|
||||
{
|
||||
logger_error("read first char error");
|
||||
logger_error("read first char error, server: %s", addr_);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user