2 #include "../acl_cpp_define.hpp" 4 #include "../stdlib/locker.hpp" 5 #include "../stdlib/noncopyable.hpp" 10 class connect_manager;
29 connect_pool(
const char* addr,
size_t max,
size_t idx = 0);
41 connect_pool& set_timeout(
int conn_timeout,
int rw_timeout);
98 int check_idle(time_t ttl,
bool exclusive =
true);
104 void set_alive(
bool ok );
154 void reset_statistics(
int inter);
170 return current_used_;
174 void set_key(
const char* key);
192 void set_delay_destroy();
223 : keep_(true), pool_(pool), conn_(NULL)
230 pool_.put(conn_, keep_);
240 conn_ = pool_.peek();
std::list< connect_client * > pool_
connect_client * peek(void)
unsigned long long total_used_
virtual ~connect_guard(void)
unsigned long long current_used_
const char * get_addr() const
unsigned long long get_total_used() const
connect_guard(connect_pool &pool)
const char * get_key(void) const
unsigned long long get_current_used() const