refactoring
parent
f0630be240
commit
9380d3cef4
@ -1,44 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-2019 Nikita Koksharov
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.redisson.connection;
|
||||
|
||||
import io.netty.channel.socket.DatagramChannel;
|
||||
import io.netty.channel.socket.nio.NioDatagramChannel;
|
||||
import io.netty.resolver.ResolvedAddressTypes;
|
||||
import io.netty.resolver.dns.DnsAddressResolverGroup;
|
||||
import io.netty.resolver.dns.DnsNameResolverBuilder;
|
||||
import io.netty.resolver.dns.DnsServerAddressStreamProvider;
|
||||
import io.netty.resolver.dns.DnsServerAddressStreamProviders;
|
||||
|
||||
/**
|
||||
* Workaround for https://github.com/netty/netty/issues/8261
|
||||
*
|
||||
* @author Nikita Koksharov
|
||||
*
|
||||
*/
|
||||
public class MultiDnsAddressResolverGroupFactory implements AddressResolverGroupFactory {
|
||||
|
||||
@Override
|
||||
public DnsAddressResolverGroup create(Class<? extends DatagramChannel> channelType,
|
||||
DnsServerAddressStreamProvider nameServerProvider) {
|
||||
|
||||
return new DnsAddressResolverGroup(new DnsNameResolverBuilder()
|
||||
.channelType(NioDatagramChannel.class)
|
||||
.nameServerProvider(DnsServerAddressStreamProviders.platformDefault())
|
||||
.resolvedAddressTypes(ResolvedAddressTypes.IPV4_ONLY));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue