Replace usage of UnknownHostException with UnresolveableAddressException. Part of [#2262]
Motivation: We better use UnresolveableAddressException as NIO does the same. Modifications: Replace usage of UnknownHostException with UnresolveableAddressException Result: epoll transport and nio transport behave the same way
This commit is contained in:
parent
a17d28605a
commit
140f963d60
@ -23,7 +23,7 @@ import io.netty.channel.EventLoop;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.nio.channels.UnresolvedAddressException;
|
||||||
|
|
||||||
abstract class AbstractEpollChannel extends AbstractChannel {
|
abstract class AbstractEpollChannel extends AbstractChannel {
|
||||||
private static final ChannelMetadata DATA = new ChannelMetadata(false);
|
private static final ChannelMetadata DATA = new ChannelMetadata(false);
|
||||||
@ -129,9 +129,9 @@ abstract class AbstractEpollChannel extends AbstractChannel {
|
|||||||
@Override
|
@Override
|
||||||
protected abstract AbstractEpollUnsafe newUnsafe();
|
protected abstract AbstractEpollUnsafe newUnsafe();
|
||||||
|
|
||||||
protected static void checkResolvable(InetSocketAddress addr) throws UnknownHostException {
|
protected static void checkResolvable(InetSocketAddress addr) {
|
||||||
if (addr.isUnresolved()) {
|
if (addr.isUnresolved()) {
|
||||||
throw new UnknownHostException("Unable to resolve addr " + addr);
|
throw new UnresolvedAddressException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user