| 100 | } |
| 101 | |
| 102 | void Resolver::onTimer() |
| 103 | { |
| 104 | assert(timerActive_ == true); |
| 105 | ares_process_fd(ctx_, ARES_SOCKET_BAD, ARES_SOCKET_BAD); |
| 106 | struct timeval tv; |
| 107 | struct timeval* tvp = ares_timeout(ctx_, NULL, &tv); |
| 108 | double timeout = getSeconds(tvp); |
| 109 | LOG_DEBUG << loop_->pollReturnTime().toString() << " next timeout " << timeout; |
| 110 | |
| 111 | if (timeout < 0) |
| 112 | { |
| 113 | timerActive_ = false; |
| 114 | } |
| 115 | else |
| 116 | { |
| 117 | loop_->runAfter(timeout, std::bind(&Resolver::onTimer, this)); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | void Resolver::onQueryResult(int status, struct hostent* result, const Callback& callback) |
| 122 | { |
nothing calls this directly
no test coverage detected