Net-DNS_A
view release on metacpan or search on metacpan
MODULE = Net::DNS_A PACKAGE = Net::DNS_A
void
lookup(host)
char *host
INIT:
int res;
struct sigevent sev;
struct gaicb *gptr = &gcb;
PPCODE:
if (count) {
XPUSHs(sv_2mortal(newSViv(0)));
XPUSHs(sv_2mortal(newSVpv("Please call retrieve()", 0)));
}
else {
gcb.ar_name = host;
sev.sigev_notify = SIGEV_NONE;
res = getaddrinfo_a(GAI_NOWAIT, &gptr, 1, &sev);
if (res) {
++count;
XPUSHs(sv_2mortal(newSViv(1)));
}
}
void
retrieve()
INIT:
int res;
char host[NI_MAXHOST];
PPCODE:
if (0 == count) {
XPUSHs(sv_2mortal(newSViv(0)));
XPUSHs(sv_2mortal(newSVpv("Please call lookup()", 0)));
}
else {
res = gai_error(&gcb);
if (EAI_INPROGRESS == res) {
XPUSHs(sv_2mortal(newSViv(0)));
( run in 0.486 second using v1.01-cache-2.11-cpan-5511b514fd6 )