acl
3.5.3.0
|
#include <tcp_keeper.hpp>
Public 成员函数 | |
tcp_keeper (void) | |
~tcp_keeper (void) | |
tcp_keeper & | set_conn_timeout (int n) |
tcp_keeper & | set_rw_timeout (int n) |
tcp_keeper & | set_conn_min (int n) |
tcp_keeper & | set_conn_max (int n) |
tcp_keeper & | set_conn_ttl (int ttl) |
tcp_keeper & | set_pool_ttl (int ttl) |
tcp_keeper & | set_rtt_min (double rtt) |
socket_stream * | peek (const char *addr, bool *hit=NULL, bool sync=false) |
void | stop (void) |
Public 成员函数 继承自 acl::acl::thread | |
thread (void) | |
virtual | ~thread (void) |
bool | start (bool sync=false) |
bool | wait (void **out=NULL) |
thread & | set_detachable (bool yes) |
thread & | set_stacksize (size_t size) |
unsigned long | thread_id (void) const |
Public 成员函数 继承自 acl::acl::thread_job | |
thread_job (void) | |
virtual | ~thread_job (void) |
virtual void | init (void) |
Protected 成员函数 | |
void * | run (void) |
Protected 成员函数 继承自 acl::acl::noncopyable | |
noncopyable () | |
~noncopyable () | |
额外继承的成员函数 | |
静态 Public 成员函数 继承自 acl::acl::thread | |
static unsigned long | thread_self (void) |
static unsigned long | self (void) |
鐙珛绾跨▼鐢ㄤ簬棰勫厛涓庢湇鍔″櫒鍒涘缓绌洪棽杩炴帴锛屽鎴风鍙互鐩存帴浠庤杩炴帴姹犱腑鑾峰彇鏂拌繛鎺ワ紝 杩欏浜 ping rtt 杈冮暱锛堝锛10ms 浠ヤ笂锛夋瘮杈冩湁浠峰€硷紝鍙互鏈夋晥鍦板噺灏戝洜缃戠粶 rtt 閫犳垚鐨勮繛鎺ユ椂闂存崯鑰
在文件 tcp_keeper.hpp 第 16 行定义.
acl::tcp_keeper::tcp_keeper | ( | void | ) |
acl::tcp_keeper::~tcp_keeper | ( | void | ) |
socket_stream* acl::tcp_keeper::peek | ( | const char * | addr, |
bool * | hit = NULL , |
||
bool | sync = false |
||
) |
浠 tcp_keeper 瀵硅薄涓彁鍙栧搴斿湴鍧€鐨勭綉缁滆繛鎺ュ鎺
addr | {const char*} 鏈嶅姟鍣ㄥ湴鍧€锛屾牸寮忥細ip:port |
hit | {bool*} 闈炵┖鏃讹紝灏嗗瓨鏀捐杩炴帴鏄惁鍦ㄨ繛鎺ユ睜鐨勭┖闂茶繛鎺ヤ腑鍛戒腑 |
sync | {bool} 鏄惁閲囩敤鐩磋繛妯″紡锛屽鏋滈噰鐢ㄧ洿杩炴ā寮忥紝鍒欏唴閮ㄤ笉浼 閽堝璇ュ湴鍧€棰勫垱杩炴帴姹 |
|
protectedvirtual |
实现了 acl::acl::thread_job.
tcp_keeper& acl::tcp_keeper::set_conn_max | ( | int | n | ) |
tcp_keeper& acl::tcp_keeper::set_conn_min | ( | int | n | ) |
tcp_keeper& acl::tcp_keeper::set_conn_timeout | ( | int | n | ) |
tcp_keeper& acl::tcp_keeper::set_conn_ttl | ( | int | ttl | ) |
tcp_keeper& acl::tcp_keeper::set_pool_ttl | ( | int | ttl | ) |
璁剧疆姣忎釜杩炴帴姹犵殑绌洪棽鏃堕棿锛堢锛夛紝鍗冲綋璇ヨ繛鎺ユ睜鐨勭┖闂叉椂闂磋秴杩囨鍊兼椂 灏嗚閲婃斁锛屼粠鑰屼究浜庣郴缁熷洖鏀跺唴瀛樿祫婧
ttl | {int} |
tcp_keeper& acl::tcp_keeper::set_rtt_min | ( | double | rtt | ) |
璁剧疆 rtt 闃€鍊硷紙绉掞級锛屽綋缃戠粶杩炴帴鏃堕棿瓒呰繃姝ゅ€兼椂鎵嶄細鍚敤浠庤繛鎺ユ睜鎻愬彇 杩炴帴鏂瑰紡锛屽鏋滅綉缁滆繛鎺ユ椂闂村皬浜庢鍊硷紝鍒欑洿鎺ヨ繛鎺ユ湇鍔″櫒
rtt | {double} |
tcp_keeper& acl::tcp_keeper::set_rw_timeout | ( | int | n | ) |
void acl::tcp_keeper::stop | ( | void | ) |
鍋滄 tcp_keeper 绾跨▼杩愯