MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / dnsLookupDone

Function dnsLookupDone

src/clientbase/playing.cpp:469–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467
468
469bool 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
498void updateShots(const float dt) {

Callers 2

playingLoopFunction · 0.85
playingLoopFunction · 0.85

Calls 4

showErrorFunction · 0.50
setFdMethod · 0.45
processMethod · 0.45
getHostAddressMethod · 0.45

Tested by

no test coverage detected