[#1715] Remove extra call socket.configureBlocking(false)
This commit is contained in:
parent
8af5ea8d4f
commit
280afda013
@ -28,8 +28,6 @@ import io.netty.channel.nio.AbstractNioByteChannel;
|
||||
import io.netty.channel.socket.DefaultSocketChannelConfig;
|
||||
import io.netty.channel.socket.ServerSocketChannel;
|
||||
import io.netty.channel.socket.SocketChannelConfig;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
@ -45,8 +43,6 @@ public class NioSocketChannel extends AbstractNioByteChannel implements io.netty
|
||||
|
||||
private static final ChannelMetadata METADATA = new ChannelMetadata(false);
|
||||
|
||||
private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSocketChannel.class);
|
||||
|
||||
private static SocketChannel newSocket() {
|
||||
try {
|
||||
return SocketChannel.open();
|
||||
@ -79,21 +75,6 @@ public class NioSocketChannel extends AbstractNioByteChannel implements io.netty
|
||||
*/
|
||||
public NioSocketChannel(Channel parent, SocketChannel socket) {
|
||||
super(parent, socket);
|
||||
try {
|
||||
socket.configureBlocking(false);
|
||||
} catch (IOException e) {
|
||||
try {
|
||||
socket.close();
|
||||
} catch (IOException e2) {
|
||||
if (logger.isWarnEnabled()) {
|
||||
logger.warn(
|
||||
"Failed to close a partially initialized socket.", e2);
|
||||
}
|
||||
}
|
||||
|
||||
throw new ChannelException("Failed to enter non-blocking mode.", e);
|
||||
}
|
||||
|
||||
config = new DefaultSocketChannelConfig(this, socket.socket());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user