acl
3.5.3.0
|
#include <tcp_pool.hpp>
Public 成员函数 | |
tcp_pool (const char *addr, size_t count, size_t idx=0) | |
virtual | ~tcp_pool (void) |
bool | send (const void *data, unsigned int len, string *out=NULL) |
Public 成员函数 继承自 acl::connect_pool | |
connect_pool (const char *addr, size_t max, size_t idx=0) | |
virtual | ~connect_pool () |
connect_pool & | set_timeout (int conn_timeout, int rw_timeout) |
connect_pool & | set_retry_inter (int retry_inter) |
connect_pool & | set_idle_ttl (time_t ttl) |
connect_pool & | set_check_inter (int n) |
connect_client * | peek (bool on=true) |
void | bind_one (connect_client *conn) |
void | put (connect_client *conn, bool keep=true) |
int | check_idle (time_t ttl, bool exclusive=true) |
void | set_alive (bool ok) |
bool | aliving () |
const char * | get_addr () const |
size_t | get_max () const |
size_t | get_count () const |
size_t | get_idx () const |
void | reset_statistics (int inter) |
unsigned long long | get_total_used () const |
unsigned long long | get_current_used () const |
void | set_key (const char *key) |
const char * | get_key (void) const |
Protected 成员函数 | |
virtual connect_client * | create_connect (void) |
Protected 成员函数 继承自 acl::connect_pool | |
void | set_delay_destroy () |
Protected 成员函数 继承自 acl::acl::noncopyable | |
noncopyable () | |
~noncopyable () | |
额外继承的成员函数 | |
Protected 属性 继承自 acl::connect_pool | |
bool | alive_ |
bool | delay_destroy_ |
int | retry_inter_ |
time_t | last_dead_ |
char | key_ [256] |
char | addr_ [256] |
int | conn_timeout_ |
int | rw_timeout_ |
size_t | idx_ |
size_t | max_ |
size_t | count_ |
time_t | idle_ttl_ |
time_t | last_check_ |
int | check_inter_ |
locker | lock_ |
unsigned long long | total_used_ |
unsigned long long | current_used_ |
time_t | last_ |
std::list< connect_client * > | pool_ |
在文件 tcp_pool.hpp 第 11 行定义.
acl::tcp_pool::tcp_pool | ( | const char * | addr, |
size_t | count, | ||
size_t | idx = 0 |
||
) |
|
virtual |
|
protectedvirtual |
实现了 acl::connect_pool.
bool acl::tcp_pool::send | ( | const void * | data, |
unsigned int | len, | ||
string * | out = NULL |
||
) |
向服务器发送指定长度的数据包,该方法会自动从连接池获取连接进行发送
data | {const void*} 要发送的数据包地址 |
len | {unsigned int} 数据长度 |
out | {string*} 当该对象非 NULL 时表明需要从服务器读取响应数据, 响应结果将被存放在该缓冲区中,如果该对象为 NULL,则表示无需读取 服务器的响应数据 |