Fix SocketException in NioSocketChannelUnsafe.closeExecutor()
Related: #3464 Motivation: When a connection attempt is failed, NioSocketChannelUnsafe.closeExecutor() triggers a SocketException, suppressing the channelUnregistered() event. Modification: Do not attempt to get SO_LINGER value when a socket is not open yet. Result: One less bug
This commit is contained in:
parent
6880e27ce9
commit
5d15e18cbf
@ -332,7 +332,7 @@ public class NioSocketChannel extends AbstractNioByteChannel implements io.netty
|
|||||||
private final class NioSocketChannelUnsafe extends NioByteUnsafe {
|
private final class NioSocketChannelUnsafe extends NioByteUnsafe {
|
||||||
@Override
|
@Override
|
||||||
protected Executor closeExecutor() {
|
protected Executor closeExecutor() {
|
||||||
if (config().getSoLinger() > 0) {
|
if (javaChannel().isOpen() && config().getSoLinger() > 0) {
|
||||||
return GlobalEventExecutor.INSTANCE;
|
return GlobalEventExecutor.INSTANCE;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user