| 51 | } |
| 52 | |
| 53 | void check_client::close_callback() |
| 54 | { |
| 55 | struct timeval end; |
| 56 | gettimeofday(&end, NULL); |
| 57 | double cost = stamp_sub(end, begin_); |
| 58 | |
| 59 | if (timedout_) { |
| 60 | logger_warn("server: %s dead, timeout, spent: %.2f ms", |
| 61 | addr_.c_str(), cost); |
| 62 | timer_.get_monitor().on_timeout(addr_.c_str(), cost); |
| 63 | } else if (!aliving_) { |
| 64 | logger_warn("server: %s dead, spent: %.2f ms", |
| 65 | addr_.c_str(), cost); |
| 66 | timer_.get_monitor().on_refused(addr_.c_str(), cost); |
| 67 | } |
| 68 | //else |
| 69 | // logger("server: %s alive, spent: %.2f ms", |
| 70 | // addr_.c_str(), spent); |
| 71 | |
| 72 | // ���ڴ˴��ĺô��DZ�֤�˵�ǰ���϶����ڹرչ����У�ͬʱ���������� |
| 73 | // �� timer_ ��ɾ���Լ��� timer_ �м�����ĸ��� |
| 74 | timer_.get_monitor().get_manager().set_pools_status(addr_, aliving_); |
| 75 | timer_.remove_client(addr_, this); |
| 76 | |
| 77 | delete this; |
| 78 | } |
| 79 | |
| 80 | bool check_client::timeout_callback() |
| 81 | { |
nothing calls this directly
no test coverage detected