Search in sources :

Example 1 with DnsAddressResolverGroup

use of io.netty.resolver.dns.DnsAddressResolverGroup in project netty by netty.

the class DnsNativeClient method main.

public static void main(String[] args) throws Exception {
    NioEventLoopGroup group = new NioEventLoopGroup(1, new DefaultThreadFactory("netty"));
    DnsAddressResolverGroup resolverGroup = new DnsAddressResolverGroup(NioDatagramChannel.class, DnsServerAddressStreamProviders.platformDefault());
    AddressResolver<InetSocketAddress> resolver = resolverGroup.getResolver(group.next());
    System.out.println(resolver);
    resolver.close();
    group.shutdownGracefully().get();
}
Also used : DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) InetSocketAddress(java.net.InetSocketAddress) DnsAddressResolverGroup(io.netty.resolver.dns.DnsAddressResolverGroup) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Aggregations

NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)1 DnsAddressResolverGroup (io.netty.resolver.dns.DnsAddressResolverGroup)1 DefaultThreadFactory (io.netty.util.concurrent.DefaultThreadFactory)1 InetSocketAddress (java.net.InetSocketAddress)1