Example usage for io.vertx.core.dns DnsClient resolveSRV

List of usage examples for io.vertx.core.dns DnsClient resolveSRV

Introduction

In this page you can find the example usage for io.vertx.core.dns DnsClient resolveSRV.

Prototype

@Fluent
DnsClient resolveSRV(String name, Handler<AsyncResult<List<SrvRecord>>> handler);

Source Link

Document

Try to resolve the SRV records for the given name.

Usage

From source file:examples.DNSExamples.java

License:Open Source License

public void example12(Vertx vertx) {
    DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
    client.resolveSRV("vertx.io", ar -> {
        if (ar.succeeded()) {
            List<SrvRecord> records = ar.result();
            for (SrvRecord record : records) {
                System.out.println(record);
            }//from  ww w  .j a v a 2 s.c  om
        } else {
            System.out.println("Failed to resolve entry" + ar.cause());
        }
    });
}