2 * A WvResolver example.
4 * Tries to look up two host names given on the command line.
6 * resolver<Err>: 1 not in DNS.
7 * resolver<Err>: 2 not in DNS.
8 * resolver<Err>: 1 not in DNS.
9 * resolver<Err>: 2 not in DNS.
10 * resolver<Err>: 1 not in DNS.
11 * resolver<Err>: 2 not in DNS.
15 #include "wvresolver.h"
18 void test(WvResolver
&dns
, int argc
, char **argv
)
20 WvLog
log("resolver", WvLog::Info
);
26 while (res1
< 0 || res2
< 0)
30 res1
= dns
.findaddr(100, argc
> 1 ? argv
[1] : "abyss.cnss.ca",
33 log
.print("Found address for 1: %s\n", (WvString
)(*addr
));
37 log(WvLog::Error
, "1 not in DNS.\n");
42 res2
= dns
.findaddr(100, argc
> 2 ? argv
[2] : "frank.foxnet.net",
45 log
.print("Found address for 2: %s\n", (WvString
)(*addr
));
49 log(WvLog::Error
, "2 not in DNS.\n");
55 int main(int argc
, char **argv
)
59 test(dns
, argc
, argv
);
60 test(dns
, argc
, argv
);
65 test(dns
, argc
, argv
);