package ru.yandex.galois.clients.utils

import io.netty.channel.epoll.Epoll
import io.netty.channel.epoll.EpollDatagramChannel
import io.netty.channel.socket.nio.NioDatagramChannel
import io.netty.resolver.AddressResolverGroup
import io.netty.resolver.dns.DnsServerAddressStreamProviders
import io.netty.resolver.dns.RoundRobinDnsAddressResolverGroup

object Resolver {
    val RESOLVER_INSTANCE: AddressResolverGroup<*> = RoundRobinDnsAddressResolverGroup(
        if (Epoll.isAvailable()) EpollDatagramChannel::class.java else NioDatagramChannel::class.java,
        DnsServerAddressStreamProviders.platformDefault()
    )
}
