3 This file is part of NetVis
4 Copyright @ 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed unter the GPL
8 #include <netinet/in.h>
10 #include <msp/time/units.h>
11 #include <msp/time/utils.h>
30 void Resolver::push(Host *h)
34 in_queue.push_back(h);
41 for(list<Result>::iterator i=out_queue.begin(); i!=out_queue.end(); ++i)
42 i->host->set_name(i->name);
57 host=in_queue.front();
58 in_queue.erase(in_queue.begin());
62 addr.sin_family=AF_INET;
63 addr.sin_addr.s_addr=htonl(host->get_address());
65 int err=getnameinfo(reinterpret_cast<sockaddr *>(&addr), sizeof(addr), buf, sizeof(buf), 0, 0, NI_NOFQDN|NI_NAMEREQD);
69 out_queue.push_back(Result(host, buf));
73 Time::sleep(Time::sec);