use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSExamples method example14.
public void example14(Vertx vertx) {
DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
client.resolvePTR("1.0.0.10.in-addr.arpa", ar -> {
if (ar.succeeded()) {
String record = ar.result();
System.out.println(record);
} else {
System.out.println("Failed to resolve entry" + ar.cause());
}
});
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSExamples method example10.
public void example10(Vertx vertx) {
DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
client.resolveTXT("vertx.io", ar -> {
if (ar.succeeded()) {
List<String> records = ar.result();
for (String record : records) {
System.out.println(record);
}
} else {
System.out.println("Failed to resolve entry" + ar.cause());
}
});
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSExamples method example4.
public void example4(Vertx vertx) {
DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
client.lookup6("vertx.io", ar -> {
if (ar.succeeded()) {
System.out.println(ar.result());
} else {
System.out.println("Failed to resolve entry" + ar.cause());
}
});
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class Examples method example16.
public void example16(Vertx vertx) {
DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
client.lookup("nonexisting.vert.xio", ar -> {
if (ar.succeeded()) {
String record = ar.result();
System.out.println(record);
} else {
Throwable cause = ar.cause();
if (cause instanceof DnsException) {
DnsException exception = (DnsException) cause;
DnsResponseCode code = exception.code();
} else {
System.out.println("Failed to resolve entry" + ar.cause());
}
}
});
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSExamples method example11.
public void example11(Vertx vertx) {
DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
client.resolveNS("vertx.io", ar -> {
if (ar.succeeded()) {
List<String> records = ar.result();
for (String record : records) {
System.out.println(record);
}
} else {
System.out.println("Failed to resolve entry" + ar.cause());
}
});
}
Aggregations