| 467 | |
| 468 | |
| 469 | bool dnsLookupDone(struct in_addr& inAddress) { |
| 470 | if (!waitingDNS) { |
| 471 | return false; |
| 472 | } |
| 473 | |
| 474 | fd_set readers, writers; |
| 475 | int nfds = -1; |
| 476 | struct timeval timeout; |
| 477 | timeout.tv_sec = 0; |
| 478 | timeout.tv_usec = 0; |
| 479 | FD_ZERO(&readers); |
| 480 | FD_ZERO(&writers); |
| 481 | ares->setFd(&readers, &writers, nfds); |
| 482 | nfds = select(nfds + 1, (fd_set*)&readers, (fd_set*)&writers, 0, &timeout); |
| 483 | ares->process(&readers, &writers); |
| 484 | |
| 485 | AresHandler::ResolutionStatus status = ares->getHostAddress(&inAddress); |
| 486 | if (status == AresHandler::Failed) { |
| 487 | showError("Server not found"); |
| 488 | waitingDNS = false; |
| 489 | } |
| 490 | else if (status == AresHandler::HbNSucceeded) { |
| 491 | waitingDNS = false; |
| 492 | return true; |
| 493 | } |
| 494 | return false; |
| 495 | } |
| 496 | |
| 497 | |
| 498 | void updateShots(const float dt) { |
no test coverage detected